From bed0151bd364daa2feed3071c297e031df9cba6c Mon Sep 17 00:00:00 2001 From: i-chvets <113444075+i-chvets@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:39:01 -0400 Subject: [PATCH] feat: configurable images for istio-gateway (#323) # Description More details in: https://github.com/canonical/istio-operators/issues/322 # Summary of changes: - Added proxy-image config option. - Updated manifest template with placeholder for proxy image. - Modified charm code to render manifest with proxy image from configuration. # Testing For complete testing refer to https://github.com/canonical/istio-operators/issues/322 --------- Co-authored-by: Orfeas Kourkakis --- charms/istio-gateway/config.yaml | 4 ++++ charms/istio-gateway/src/charm.py | 2 ++ charms/istio-gateway/src/manifest.yaml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/charms/istio-gateway/config.yaml b/charms/istio-gateway/config.yaml index 354ba4c9..652dabb7 100644 --- a/charms/istio-gateway/config.yaml +++ b/charms/istio-gateway/config.yaml @@ -8,3 +8,7 @@ options: type: string description: | Type of service for the ingress gateway out of: 'ClusterIP', 'LoadBalancer', or 'NodePort'. + proxy-image: + default: 'docker.io/istio/proxyv2:1.17.3' + description: Istio Proxy image + type: string diff --git a/charms/istio-gateway/src/charm.py b/charms/istio-gateway/src/charm.py index 71a013e6..03829693 100755 --- a/charms/istio-gateway/src/charm.py +++ b/charms/istio-gateway/src/charm.py @@ -69,6 +69,7 @@ def start(self, event): rendered = template.render( kind=self.model.config["kind"], namespace=self.model.name, + proxy_image=self.model.config["proxy-image"], pilot_host=pilot["service-name"], pilot_port=pilot["service-port"], gateway_service_type=self.model.config["gateway_service_type"], @@ -88,6 +89,7 @@ def remove(self, event): rendered = template.render( kind=self.model.config["kind"], namespace=self.model.name, + proxy_image=self.model.config["proxy-image"], pilot_host="foo", pilot_port="foo", ) diff --git a/charms/istio-gateway/src/manifest.yaml b/charms/istio-gateway/src/manifest.yaml index d8e7fd33..c4f5c227 100644 --- a/charms/istio-gateway/src/manifest.yaml +++ b/charms/istio-gateway/src/manifest.yaml @@ -116,7 +116,7 @@ spec: value: standard - name: ISTIO_META_CLUSTER_ID value: Kubernetes - image: docker.io/istio/proxyv2:1.17.3 + image: {{ proxy_image }} name: istio-proxy ports: - containerPort: 15021