Skip to content

Commit 7576b2b

Browse files
committed
hypershift: Add desired-version annotation to controller Deployments
New annotation `release.openshift.io/desired-version` will be used by CSI driver operators to compare the version from env var `OPERATOR_IMAGE_VERSION` with actual version of currently running operand.
1 parent 9816f92 commit 7576b2b

File tree

14 files changed

+802
-0
lines changed

14 files changed

+802
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
metadata:
2+
annotations:
3+
release.openshift.io/desired-version: ${RELEASE_VERSION}

assets/overlays/aws-ebs/generated/hypershift/controller.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
# Applied strategic merge patch pod_network_livenessprobe.yaml
2525
# Applied strategic merge patch common/hypershift/controller_add_affinity_tolerations.yaml
2626
# Applied JSON patch common/hypershift/controller_add_kubeconfig_volume.yaml.patch
27+
# Applied strategic merge patch common/hypershift/controller_add_hypershift_desired_version_annotation.yaml
2728
# Applied strategic merge patch overlays/aws-ebs/patches/controller_add_hypershift_controller_minter.yaml
2829
#
2930
#
@@ -34,6 +35,7 @@ metadata:
3435
annotations:
3536
config.openshift.io/inject-proxy: csi-driver
3637
config.openshift.io/inject-proxy-cabundle: csi-driver
38+
release.openshift.io/desired-version: ${RELEASE_VERSION}
3739
name: aws-ebs-csi-driver-controller
3840
namespace: ${NAMESPACE}
3941
spec:

assets/overlays/azure-disk/generated/hypershift/controller.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
# Applied strategic merge patch pod_network_livenessprobe.yaml
2525
# Applied strategic merge patch common/hypershift/controller_add_affinity_tolerations.yaml
2626
# Applied JSON patch common/hypershift/controller_add_kubeconfig_volume.yaml.patch
27+
# Applied strategic merge patch common/hypershift/controller_add_hypershift_desired_version_annotation.yaml
2728
# Applied strategic merge patch overlays/azure-disk/patches/controller_add_hypershift_controller.yaml
2829
#
2930
#
@@ -34,6 +35,7 @@ metadata:
3435
annotations:
3536
config.openshift.io/inject-proxy: csi-driver
3637
config.openshift.io/inject-proxy-cabundle: csi-driver
38+
release.openshift.io/desired-version: ${RELEASE_VERSION}
3739
name: azure-disk-csi-driver-controller
3840
namespace: ${NAMESPACE}
3941
spec:

assets/overlays/azure-file/generated/hypershift/controller.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
# Applied strategic merge patch pod_network_livenessprobe.yaml
2525
# Applied strategic merge patch common/hypershift/controller_add_affinity_tolerations.yaml
2626
# Applied JSON patch common/hypershift/controller_add_kubeconfig_volume.yaml.patch
27+
# Applied strategic merge patch common/hypershift/controller_add_hypershift_desired_version_annotation.yaml
2728
# Applied JSON patch common/hypershift/sidecar_add_kubeconfig.yaml.patch
2829
# Applied strategic merge patch overlays/azure-file/patches/controller_add_hypershift_controller.yaml
2930
#
@@ -35,6 +36,7 @@ metadata:
3536
annotations:
3637
config.openshift.io/inject-proxy: csi-driver
3738
config.openshift.io/inject-proxy-cabundle: csi-driver
39+
release.openshift.io/desired-version: ${RELEASE_VERSION}
3840
name: azure-file-csi-driver-controller
3941
namespace: ${NAMESPACE}
4042
spec:

assets/overlays/openstack-cinder/generated/hypershift/controller.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# Applied strategic merge patch pod_network_livenessprobe.yaml
2323
# Applied strategic merge patch common/hypershift/controller_add_affinity_tolerations.yaml
2424
# Applied JSON patch common/hypershift/controller_add_kubeconfig_volume.yaml.patch
25+
# Applied strategic merge patch common/hypershift/controller_add_hypershift_desired_version_annotation.yaml
2526
# Applied strategic merge patch overlays/openstack-cinder/patches/controller_add_hypershift_volumes.yaml
2627
#
2728
#
@@ -32,6 +33,7 @@ metadata:
3233
annotations:
3334
config.openshift.io/inject-proxy: csi-driver
3435
config.openshift.io/inject-proxy-cabundle: csi-driver
36+
release.openshift.io/desired-version: ${RELEASE_VERSION}
3537
name: openstack-cinder-csi-driver-controller
3638
namespace: ${NAMESPACE}
3739
spec:

assets/overlays/openstack-manila/generated/hypershift/controller.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# Applied strategic merge patch pod_network_livenessprobe.yaml
1919
# Applied strategic merge patch common/hypershift/controller_add_affinity_tolerations.yaml
2020
# Applied JSON patch common/hypershift/controller_add_kubeconfig_volume.yaml.patch
21+
# Applied strategic merge patch common/hypershift/controller_add_hypershift_desired_version_annotation.yaml
2122
# Applied strategic merge patch overlays/openstack-manila/patches/controller_add_hypershift_volumes.yaml
2223
# Applied strategic merge patch overlays/openstack-manila/patches/controller_rename_config_map.yaml
2324
# Applied strategic merge patch overlays/openstack-manila/patches/modify_anti_affinity_selector.yaml
@@ -30,6 +31,7 @@ metadata:
3031
annotations:
3132
config.openshift.io/inject-proxy: csi-driver
3233
config.openshift.io/inject-proxy-cabundle: csi-driver
34+
release.openshift.io/desired-version: ${RELEASE_VERSION}
3335
name: openstack-manila-csi-controllerplugin
3436
namespace: ${NAMESPACE}
3537
spec:

pkg/driver/common/generator/base_assets.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var (
4545
"controller_sa.yaml", "common/hypershift/controller_sa_pull_secret.yaml",
4646
"controller.yaml", "common/hypershift/controller_add_affinity_tolerations.yaml",
4747
"controller.yaml", "common/hypershift/controller_add_kubeconfig_volume.yaml.patch",
48+
"controller.yaml", "common/hypershift/controller_add_hypershift_desired_version_annotation.yaml",
4849
)
4950
)
5051

pkg/driver/common/operator/replacer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package operator
22

33
import (
44
"os"
5+
6+
"github.com/openshift/library-go/pkg/operator/status"
57
)
68

79
const (
@@ -67,5 +69,6 @@ func DefaultReplacements(controlPlaneNamespace, guestNamespace string) []string
6769

6870
pairs = append(pairs, []string{"${NAMESPACE}", controlPlaneNamespace}...)
6971
pairs = append(pairs, []string{"${NODE_NAMESPACE}", guestNamespace}...)
72+
pairs = append(pairs, []string{"${RELEASE_VERSION}", status.VersionForOperatorFromEnv()}...)
7073
return pairs
7174
}

vendor/github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers/status.go

Lines changed: 143 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)