Skip to content

Commit

Permalink
Configure minimum version of ztunnel to 1.24
Browse files Browse the repository at this point in the history
Signed-off-by: Sridhar Gaddam <[email protected]>
  • Loading branch information
sridhargaddam committed Dec 6, 2024
1 parent ca3e652 commit f178eb6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
6 changes: 3 additions & 3 deletions api/v1alpha1/ztunnel_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
9 changes: 2 additions & 7 deletions bundle/manifests/sailoperator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions bundle/manifests/sailoperator.io_ztunnels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 1 addition & 6 deletions chart/crds/sailoperator.io_ztunnels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/sailoperator.io.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | | |
Expand Down
16 changes: 15 additions & 1 deletion hack/update-version-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f178eb6

Please sign in to comment.