Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ztunnel versions in update_version-list.sh #509

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions api/v1alpha1/ztunnel_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const (
type ZTunnelSpec struct {
// +sail:version
// Defines the version of Istio to install.
// Must be one of: v1.24.0 or 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.0", "urn:alm:descriptor:com.tectonic.ui:select:latest"}
// +kubebuilder:validation:Enum=v1.24.0;latest
// +kubebuilder:default=v1.24.0
// 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"`

// +sail:profile
Expand Down Expand Up @@ -178,7 +178,7 @@ type ZTunnel struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:default={version: "v1.24.0", namespace: "ztunnel", profile: "ambient"}
// +kubebuilder:default={version: "v1.24.1", namespace: "ztunnel", profile: "ambient"}
Spec ZTunnelSpec `json:"spec,omitempty"`

Status ZTunnelStatus `json:"status,omitempty"`
Expand Down
5 changes: 3 additions & 2 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,11 +320,12 @@ spec:
specDescriptors:
- description: |-
Defines the version of Istio to install.
Must be one of: v1.24.0 or 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:latest
- description: Namespace to which the Istio ztunnel component should be installed.
Expand Down
7 changes: 4 additions & 3 deletions bundle/manifests/sailoperator.io_ztunnels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
default:
namespace: ztunnel
profile: ambient
version: v1.24.0
version: v1.24.1
description: ZTunnelSpec defines the desired state of ZTunnel
properties:
namespace:
Expand Down Expand Up @@ -5493,11 +5493,12 @@ spec:
type: object
type: object
version:
default: v1.24.0
default: v1.24.1
description: |-
Defines the version of Istio to install.
Must be one of: v1.24.0 or latest.
Must be one of: v1.24.1, v1.24.0, latest.
enum:
- v1.24.1
- v1.24.0
- latest
type: string
Expand Down
7 changes: 4 additions & 3 deletions chart/crds/sailoperator.io_ztunnels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
default:
namespace: ztunnel
profile: ambient
version: v1.24.0
version: v1.24.1
description: ZTunnelSpec defines the desired state of ZTunnel
properties:
namespace:
Expand Down Expand Up @@ -5493,11 +5493,12 @@ spec:
type: object
type: object
version:
default: v1.24.0
default: v1.24.1
description: |-
Defines the version of Istio to install.
Must be one of: v1.24.0 or latest.
Must be one of: v1.24.1, v1.24.0, latest.
enum:
- v1.24.1
- v1.24.0
- latest
type: string
Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/sailoperator.io.md
Original file line number Diff line number Diff line change
Expand Up @@ -3138,7 +3138,7 @@ _Appears in:_
| `kind` _string_ | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | | |
| `apiVersion` _string_ | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | | |
| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | |
| `spec` _[ZTunnelSpec](#ztunnelspec)_ | | \{ namespace:ztunnel profile:ambient version:v1.24.0 \} | |
| `spec` _[ZTunnelSpec](#ztunnelspec)_ | | \{ namespace:ztunnel profile:ambient version:v1.24.1 \} | |
| `status` _[ZTunnelStatus](#ztunnelstatus)_ | | | |


Expand Down 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.0 or latest. | v1.24.0 | Enum: [v1.24.0 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
14 changes: 14 additions & 0 deletions hack/update-version-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ function updateVersionsInIstioTypeComment() {
-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

# 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
Loading