From f178eb625c63f7f56166ecc0ef0a9bccf2d771f4 Mon Sep 17 00:00:00 2001 From: Sridhar Gaddam Date: Fri, 6 Dec 2024 14:20:10 +0530 Subject: [PATCH] Configure minimum version of ztunnel to 1.24 Signed-off-by: Sridhar Gaddam --- api/v1alpha1/ztunnel_types.go | 6 +++--- .../sailoperator.clusterserviceversion.yaml | 9 ++------- bundle/manifests/sailoperator.io_ztunnels.yaml | 7 +------ chart/crds/sailoperator.io_ztunnels.yaml | 7 +------ docs/api-reference/sailoperator.io.md | 2 +- hack/update-version-list.sh | 16 +++++++++++++++- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/api/v1alpha1/ztunnel_types.go b/api/v1alpha1/ztunnel_types.go index a81fc4cf2..566346f69 100644 --- a/api/v1alpha1/ztunnel_types.go +++ b/api/v1alpha1/ztunnel_types.go @@ -28,9 +28,9 @@ const ( type ZTunnelSpec struct { // +sail:version // Defines the version of Istio to install. - // Must be one of: v1.24.1, v1.24.0, v1.23.3, v1.23.2, v1.22.6, v1.22.5, v1.21.6, latest. - // +operator-sdk:csv:customresourcedefinitions:type=spec,order=1,displayName="Istio Version",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:fieldGroup:General", "urn:alm:descriptor:com.tectonic.ui:select:v1.24.1", "urn:alm:descriptor:com.tectonic.ui:select:v1.24.0", "urn:alm:descriptor:com.tectonic.ui:select:v1.23.3", "urn:alm:descriptor:com.tectonic.ui:select:v1.23.2", "urn:alm:descriptor:com.tectonic.ui:select:v1.22.6", "urn:alm:descriptor:com.tectonic.ui:select:v1.22.5", "urn:alm:descriptor:com.tectonic.ui:select:v1.21.6", "urn:alm:descriptor:com.tectonic.ui:select:latest"} - // +kubebuilder:validation:Enum=v1.24.1;v1.24.0;v1.23.3;v1.23.2;v1.22.6;v1.22.5;v1.21.6;latest + // Must be one of: v1.24.1, v1.24.0, latest. + // +operator-sdk:csv:customresourcedefinitions:type=spec,order=1,displayName="Istio Version",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:fieldGroup:General", "urn:alm:descriptor:com.tectonic.ui:select:v1.24.1", "urn:alm:descriptor:com.tectonic.ui:select:v1.24.0", "urn:alm:descriptor:com.tectonic.ui:select:latest"} + // +kubebuilder:validation:Enum=v1.24.1;v1.24.0;latest // +kubebuilder:default=v1.24.1 Version string `json:"version"` diff --git a/bundle/manifests/sailoperator.clusterserviceversion.yaml b/bundle/manifests/sailoperator.clusterserviceversion.yaml index 44b9529b1..14ce27bcf 100644 --- a/bundle/manifests/sailoperator.clusterserviceversion.yaml +++ b/bundle/manifests/sailoperator.clusterserviceversion.yaml @@ -34,7 +34,7 @@ metadata: capabilities: Seamless Upgrades categories: OpenShift Optional, Integration & Delivery, Networking, Security containerImage: quay.io/maistra-dev/sail-operator:0.2-latest - createdAt: "2024-12-06T05:05:33Z" + createdAt: "2024-12-06T08:47:58Z" description: Experimental operator for installing Istio service mesh features.operators.openshift.io/cnf: "false" features.operators.openshift.io/cni: "true" @@ -320,18 +320,13 @@ spec: specDescriptors: - description: |- Defines the version of Istio to install. - Must be one of: v1.24.1, v1.24.0, v1.23.3, v1.23.2, v1.22.6, v1.22.5, v1.21.6, latest. + Must be one of: v1.24.1, v1.24.0, latest. displayName: Istio Version path: version x-descriptors: - urn:alm:descriptor:com.tectonic.ui:fieldGroup:General - urn:alm:descriptor:com.tectonic.ui:select:v1.24.1 - urn:alm:descriptor:com.tectonic.ui:select:v1.24.0 - - urn:alm:descriptor:com.tectonic.ui:select:v1.23.3 - - urn:alm:descriptor:com.tectonic.ui:select:v1.23.2 - - urn:alm:descriptor:com.tectonic.ui:select:v1.22.6 - - urn:alm:descriptor:com.tectonic.ui:select:v1.22.5 - - urn:alm:descriptor:com.tectonic.ui:select:v1.21.6 - urn:alm:descriptor:com.tectonic.ui:select:latest - description: Namespace to which the Istio ztunnel component should be installed. displayName: Namespace diff --git a/bundle/manifests/sailoperator.io_ztunnels.yaml b/bundle/manifests/sailoperator.io_ztunnels.yaml index 847cf784b..3a0bd2ccc 100644 --- a/bundle/manifests/sailoperator.io_ztunnels.yaml +++ b/bundle/manifests/sailoperator.io_ztunnels.yaml @@ -5496,15 +5496,10 @@ spec: default: v1.24.1 description: |- Defines the version of Istio to install. - Must be one of: v1.24.1, v1.24.0, v1.23.3, v1.23.2, v1.22.6, v1.22.5, v1.21.6, latest. + Must be one of: v1.24.1, v1.24.0, latest. enum: - v1.24.1 - v1.24.0 - - v1.23.3 - - v1.23.2 - - v1.22.6 - - v1.22.5 - - v1.21.6 - latest type: string required: diff --git a/chart/crds/sailoperator.io_ztunnels.yaml b/chart/crds/sailoperator.io_ztunnels.yaml index 80ef4819e..532cda15c 100644 --- a/chart/crds/sailoperator.io_ztunnels.yaml +++ b/chart/crds/sailoperator.io_ztunnels.yaml @@ -5496,15 +5496,10 @@ spec: default: v1.24.1 description: |- Defines the version of Istio to install. - Must be one of: v1.24.1, v1.24.0, v1.23.3, v1.23.2, v1.22.6, v1.22.5, v1.21.6, latest. + Must be one of: v1.24.1, v1.24.0, latest. enum: - v1.24.1 - v1.24.0 - - v1.23.3 - - v1.23.2 - - v1.22.6 - - v1.22.5 - - v1.21.6 - latest type: string required: diff --git a/docs/api-reference/sailoperator.io.md b/docs/api-reference/sailoperator.io.md index 9ddd52763..01036430e 100644 --- a/docs/api-reference/sailoperator.io.md +++ b/docs/api-reference/sailoperator.io.md @@ -3295,7 +3295,7 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `version` _string_ | Defines the version of Istio to install. Must be one of: v1.24.1, v1.24.0, v1.23.3, v1.23.2, v1.22.6, v1.22.5, v1.21.6, latest. | v1.24.1 | Enum: [v1.24.1 v1.24.0 v1.23.3 v1.23.2 v1.22.6 v1.22.5 v1.21.6 latest] | +| `version` _string_ | Defines the version of Istio to install. Must be one of: v1.24.1, v1.24.0, latest. | v1.24.1 | Enum: [v1.24.1 v1.24.0 latest] | | `profile` _string_ | The built-in installation configuration profile to use. The 'default' profile is 'ambient' and it is always applied. Must be one of: ambient, default, demo, empty, external, preview, remote, stable. | ambient | Enum: [ambient default demo empty external openshift-ambient openshift preview remote stable] | | `namespace` _string_ | Namespace to which the Istio ztunnel component should be installed. | ztunnel | | | `values` _[ZTunnelValues](#ztunnelvalues)_ | Defines the values to be passed to the Helm charts when installing Istio ztunnel. | | | diff --git a/hack/update-version-list.sh b/hack/update-version-list.sh index 1cf260686..8a7d62dc8 100755 --- a/hack/update-version-list.sh +++ b/hack/update-version-list.sh @@ -31,7 +31,21 @@ function updateVersionsInIstioTypeComment() { -e "/\+sail:version/,/Version string/ s/(\/\/ \+kubebuilder:default=)(.*)/\1$defaultVersion/g" \ -e "/\+sail:version/,/Version string/ s/(\/\/ \Must be one of:)(.*)/\1 $versions./g" \ -e "s/(\+kubebuilder:default=.*version: \")[^\"]*\"/\1$defaultVersion\"/g" \ - api/v1alpha1/istio_types.go api/v1alpha1/istiorevision_types.go api/v1alpha1/istiocni_types.go api/v1alpha1/ztunnel_types.go + api/v1alpha1/istio_types.go api/v1alpha1/istiorevision_types.go api/v1alpha1/istiocni_types.go + + # Ambient mode in Sail Operator is supported starting with Istio version 1.24+ + # TODO: Once support for versions prior to 1.24 is discontinued, we can merge the ztunnel specific changes below with the other components. + ztunnelselectValues=$(yq '.versions[] | select(.version >= "1.24.0") | ", \"urn:alm:descriptor:com.tectonic.ui:select:" + .name + "\""' "${VERSIONS_YAML_FILE}" | tr -d '\n') + ztunnelversionsEnum=$(yq '.versions[] | select(.version >= "1.24.0") | .name' "${VERSIONS_YAML_FILE}" | tr '\n' ';' | sed 's/;$//g') + ztunnelversions=$(yq '.versions[] | select(.version >= "1.24.0") | .name' "${VERSIONS_YAML_FILE}" | tr '\n' ',' | sed -e 's/,/, /g' -e 's/, $//g') + + sed -i -E \ + -e "/\+sail:version/,/Version string/ s/(\/\/ \+operator-sdk:csv:customresourcedefinitions:type=spec,order=1,displayName=\"Istio Version\",xDescriptors=\{.*fieldGroup:General\")[^}]*(})/\1$ztunnelselectValues}/g" \ + -e "/\+sail:version/,/Version string/ s/(\/\/ \+kubebuilder:validation:Enum=)(.*)/\1$ztunnelversionsEnum/g" \ + -e "/\+sail:version/,/Version string/ s/(\/\/ \+kubebuilder:default=)(.*)/\1$defaultVersion/g" \ + -e "/\+sail:version/,/Version string/ s/(\/\/ \Must be one of:)(.*)/\1 $ztunnelversions./g" \ + -e "s/(\+kubebuilder:default=.*version: \")[^\"]*\"/\1$defaultVersion\"/g" \ + api/v1alpha1/ztunnel_types.go } function updateVersionsInCSVDescription() {