Skip to content

Commit 4ea4891

Browse files
authored
OADP-698, OADP-296 Get data mover image from manager env, migrate to RELATED_IMAGE_ (#786)
* `make bundle` * go changes * UPPERCASE * _
1 parent 63b0143 commit 4ea4891

File tree

13 files changed

+71
-126
lines changed

13 files changed

+71
-126
lines changed

build/Dockerfile.bundle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=oadp-operator
88
LABEL operators.operatorframework.io.bundle.channels.v1=stable
99
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
10-
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.14.0
10+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.21.0
1111
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1212
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
1313

bundle.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=oadp-operator
88
LABEL operators.operatorframework.io.bundle.channels.v1=stable
99
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
10-
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.14.0
10+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.21.0
1111
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1212
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
1313

bundle/manifests/oadp-operator.clusterserviceversion.yaml

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ metadata:
169169
operatorframework.io/suggested-namespace: openshift-adp
170170
operators.openshift.io/infrastructure-features: '["Disconnected"]'
171171
operators.openshift.io/valid-subscription: '["OpenShift Container Platform", "OpenShift Platform Plus"]'
172-
operators.operatorframework.io/builder: operator-sdk-v1.14.0
172+
operators.operatorframework.io/builder: operator-sdk-v1.21.0
173173
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
174174
repository: https://github.com/openshift/oadp-operator
175175
support: Red Hat
@@ -726,42 +726,24 @@ spec:
726726
valueFrom:
727727
fieldRef:
728728
fieldPath: metadata.annotations['olm.targetNamespaces']
729-
- name: REGISTRY
730-
value: quay.io
731-
- name: PROJECT
732-
value: konveyor
733-
- name: VELERO_REPO
734-
value: velero
735-
- name: VELERO_OPENSHIFT_PLUGIN_REPO
736-
value: openshift-velero-plugin
737-
- name: VELERO_OPENSHIFT_PLUGIN_TAG
738-
value: latest
739-
- name: VELERO_RESTIC_RESTORE_HELPER_REPO
740-
value: velero-restic-restore-helper
741-
- name: VELERO_AWS_PLUGIN_REPO
742-
value: velero-plugin-for-aws
743-
- name: VELERO_GCP_PLUGIN_REPO
744-
value: velero-plugin-for-gcp
745-
- name: VELERO_AZURE_PLUGIN_REPO
746-
value: velero-plugin-for-microsoft-azure
747-
- name: VELERO_KUBEVIRT_PLUGIN_REPO
748-
value: kubevirt-velero-plugin
749-
- name: VELERO_CSI_PLUGIN_REPO
750-
value: velero-plugin-for-csi
751-
- name: VELERO_TAG
752-
value: konveyor-1.9
753-
- name: VELERO_RESTIC_RESTORE_HELPER_TAG
754-
value: konveyor-1.9
755-
- name: VELERO_AWS_PLUGIN_TAG
756-
value: konveyor-1.5
757-
- name: VELERO_GCP_PLUGIN_TAG
758-
value: konveyor-1.5
759-
- name: VELERO_AZURE_PLUGIN_TAG
760-
value: konveyor-1.5
761-
- name: VELERO_CSI_PLUGIN_TAG
762-
value: konveyor-0.3
763-
- name: VELERO_KUBEVIRT_PLUGIN_TAG
764-
value: v0.2.0
729+
- name: RELATED_IMAGE_VELERO
730+
value: quay.io/konveyor/velero:konveyor-1.9
731+
- name: RELATED_IMAGE_VELERO_RESTIC_RESTORE_HELPER
732+
value: quay.io/konveyor/velero-restic-restore-helper:konveyor-1.9
733+
- name: RELATED_IMAGE_OPENSHIFT_VELERO_PLUGIN
734+
value: quay.io/konveyor/openshift-velero-plugin:latest
735+
- name: RELATED_IMAGE_VELERO_PLUGIN_FOR_AWS
736+
value: quay.io/konveyor/velero-plugin-for-aws:konveyor-1.5
737+
- name: RELATED_IMAGE_VELERO_PLUGIN_FOR_MICROSOFT_AZURE
738+
value: quay.io/konveyor/velero-plugin-for-microsoft-azure:konveyor-1.5
739+
- name: RELATED_IMAGE_VELERO_PLUGIN_FOR_GCP
740+
value: quay.io/konveyor/velero-plugin-for-gcp:konveyor-1.5
741+
- name: RELATED_IMAGE_VELERO_PLUGIN_FOR_CSI
742+
value: quay.io/konveyor/velero-plugin-for-csi:konveyor-0.3
743+
- name: RELATED_IMAGE_VOLUME_SNAPSHOT_MOVER
744+
value: quay.io/konveyor/volume-snapshot-mover:latest
745+
- name: RELATED_IMAGE_KUBEVIRT_VELERO_PLUGIN
746+
value: quay.io/konveyor/kubevirt-velero-plugin:v0.2.0
765747
image: quay.io/konveyor/oadp-operator:latest
766748
imagePullPolicy: Always
767749
livenessProbe:
@@ -871,19 +853,19 @@ spec:
871853
- image: quay.io/konveyor/velero:konveyor-1.9
872854
name: velero
873855
- image: quay.io/konveyor/velero-restic-restore-helper:konveyor-1.9
874-
name: velero_restic_restore_helper
856+
name: velero-restic-restore-helper
875857
- image: quay.io/konveyor/openshift-velero-plugin:latest
876-
name: openshift_plugin
858+
name: openshift-velero-plugin
877859
- image: quay.io/konveyor/velero-plugin-for-aws:konveyor-1.5
878-
name: aws_plugin
860+
name: velero-plugin-for-aws
879861
- image: quay.io/konveyor/velero-plugin-for-microsoft-azure:konveyor-1.5
880-
name: azure_plugin
862+
name: velero-plugin-for-microsoft-azure
881863
- image: quay.io/konveyor/velero-plugin-for-gcp:konveyor-1.5
882-
name: gcp_plugin
864+
name: velero-plugin-for-gcp
883865
- image: quay.io/konveyor/velero-plugin-for-csi:konveyor-0.3
884-
name: csi_plugin
885-
- image: quay.io/konveyor/kubevirt-velero-plugin:v0.2.0
886-
name: kubevirt_plugin
866+
name: velero-plugin-for-csi
887867
- image: quay.io/konveyor/volume-snapshot-mover:latest
888-
name: volume_snapshot_mover
868+
name: volume-snapshot-mover
869+
- image: quay.io/konveyor/kubevirt-velero-plugin:v0.2.0
870+
name: kubevirt-velero-plugin
889871
version: 99.0.0

bundle/metadata/annotations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ annotations:
66
operators.operatorframework.io.bundle.package.v1: oadp-operator
77
operators.operatorframework.io.bundle.channels.v1: stable
88
operators.operatorframework.io.bundle.channel.default.v1: stable
9-
operators.operatorframework.io.metrics.builder: operator-sdk-v1.14.0
9+
operators.operatorframework.io.metrics.builder: operator-sdk-v1.21.0
1010
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
1111
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
1212

config/manager/manager.yaml

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -37,42 +37,24 @@ spec:
3737
valueFrom:
3838
fieldRef:
3939
fieldPath: metadata.namespace
40-
- name: REGISTRY
41-
value: quay.io
42-
- name: PROJECT
43-
value: konveyor
44-
- name: VELERO_REPO
45-
value: velero
46-
- name: VELERO_OPENSHIFT_PLUGIN_REPO
47-
value: openshift-velero-plugin
48-
- name: VELERO_OPENSHIFT_PLUGIN_TAG
49-
value: latest
50-
- name: VELERO_RESTIC_RESTORE_HELPER_REPO
51-
value: velero-restic-restore-helper
52-
- name: VELERO_AWS_PLUGIN_REPO
53-
value: velero-plugin-for-aws
54-
- name: VELERO_GCP_PLUGIN_REPO
55-
value: velero-plugin-for-gcp
56-
- name: VELERO_AZURE_PLUGIN_REPO
57-
value: velero-plugin-for-microsoft-azure
58-
- name: VELERO_KUBEVIRT_PLUGIN_REPO
59-
value: kubevirt-velero-plugin
60-
- name: VELERO_CSI_PLUGIN_REPO
61-
value: velero-plugin-for-csi
62-
- name: VELERO_TAG
63-
value: konveyor-1.9
64-
- name: VELERO_RESTIC_RESTORE_HELPER_TAG
65-
value: konveyor-1.9
66-
- name: VELERO_AWS_PLUGIN_TAG
67-
value: konveyor-1.5
68-
- name: VELERO_GCP_PLUGIN_TAG
69-
value: konveyor-1.5
70-
- name: VELERO_AZURE_PLUGIN_TAG
71-
value: konveyor-1.5
72-
- name: VELERO_CSI_PLUGIN_TAG
73-
value: konveyor-0.3
74-
- name: VELERO_KUBEVIRT_PLUGIN_TAG
75-
value: v0.2.0
40+
- name: RELATED_IMAGE_VELERO
41+
value: quay.io/konveyor/velero:konveyor-1.9
42+
- name: RELATED_IMAGE_VELERO_RESTIC_RESTORE_HELPER
43+
value: quay.io/konveyor/velero-restic-restore-helper:konveyor-1.9
44+
- name: RELATED_IMAGE_OPENSHIFT_VELERO_PLUGIN
45+
value: quay.io/konveyor/openshift-velero-plugin:latest
46+
- name: RELATED_IMAGE_VELERO_PLUGIN_FOR_AWS
47+
value: quay.io/konveyor/velero-plugin-for-aws:konveyor-1.5
48+
- name: RELATED_IMAGE_VELERO_PLUGIN_FOR_MICROSOFT_AZURE
49+
value: quay.io/konveyor/velero-plugin-for-microsoft-azure:konveyor-1.5
50+
- name: RELATED_IMAGE_VELERO_PLUGIN_FOR_GCP
51+
value: quay.io/konveyor/velero-plugin-for-gcp:konveyor-1.5
52+
- name: RELATED_IMAGE_VELERO_PLUGIN_FOR_CSI
53+
value: quay.io/konveyor/velero-plugin-for-csi:konveyor-0.3
54+
- name: RELATED_IMAGE_VOLUME_SNAPSHOT_MOVER
55+
value: quay.io/konveyor/volume-snapshot-mover:latest
56+
- name: RELATED_IMAGE_KUBEVIRT_VELERO_PLUGIN
57+
value: quay.io/konveyor/kubevirt-velero-plugin:v0.2.0
7658
args:
7759
- --leader-elect
7860
image: controller:latest

config/manifests/bases/oadp-operator.clusterserviceversion.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -340,21 +340,4 @@ spec:
340340
maturity: stable
341341
provider:
342342
name: Red Hat
343-
relatedImages:
344-
- image: quay.io/konveyor/velero:konveyor-1.9
345-
name: velero
346-
- image: quay.io/konveyor/velero-restic-restore-helper:konveyor-1.9
347-
name: velero_restic_restore_helper
348-
- image: quay.io/konveyor/openshift-velero-plugin:latest
349-
name: openshift_plugin
350-
- image: quay.io/konveyor/velero-plugin-for-aws:konveyor-1.5
351-
name: aws_plugin
352-
- image: quay.io/konveyor/velero-plugin-for-microsoft-azure:konveyor-1.5
353-
name: azure_plugin
354-
- image: quay.io/konveyor/velero-plugin-for-gcp:konveyor-1.5
355-
name: gcp_plugin
356-
- image: quay.io/konveyor/velero-plugin-for-csi:konveyor-0.3
357-
name: csi_plugin
358-
- image: quay.io/konveyor/kubevirt-velero-plugin:v0.2.0
359-
name: kubevirt_plugin
360343
version: 99.0.0

controllers/datamover.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"os"
78
"strings"
89

910
"github.com/go-logr/logr"
@@ -196,7 +197,10 @@ func (r *DPAReconciler) getDataMoverImage(dpa *oadpv1alpha1.DataProtectionApplic
196197
if dpa.Spec.UnsupportedOverrides[oadpv1alpha1.DataMoverImageKey] != "" {
197198
return dpa.Spec.UnsupportedOverrides[oadpv1alpha1.DataMoverImageKey]
198199
}
199-
return common.DataMoverImage
200+
if os.Getenv("RELATED_IMAGE_VOLUME_SNAPSHOT_MOVER") == "" {
201+
return common.DataMoverImage
202+
}
203+
return os.Getenv("RELATED_IMAGE_VOLUME_SNAPSHOT_MOVER")
200204
}
201205

202206
func (r *DPAReconciler) getDataMoverLabels() map[string]string {

controllers/restic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func (r *DPAReconciler) updateResticRestoreHelperCM(resticRestoreHelperCM *corev
334334
}
335335

336336
resticRestoreHelperCM.Data = map[string]string{
337-
"image": fmt.Sprintf("%v/%v/%v:%v", os.Getenv("REGISTRY"), os.Getenv("PROJECT"), os.Getenv("VELERO_RESTIC_RESTORE_HELPER_REPO"), os.Getenv("VELERO_RESTIC_RESTORE_HELPER_TAG")),
337+
"image": os.Getenv("RELATED_IMAGE_VELERO_RESTIC_RESTORE_HELPER"),
338338
}
339339

340340
return nil

controllers/restic_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package controllers
22

33
import (
44
"context"
5-
"fmt"
65
"os"
76
"reflect"
87
"testing"
@@ -2154,7 +2153,7 @@ func TestDPAReconciler_updateResticRestoreHelperCM(t *testing.T) {
21542153
},
21552154
},
21562155
Data: map[string]string{
2157-
"image": fmt.Sprintf("%v/%v/%v:%v", os.Getenv("REGISTRY"), os.Getenv("PROJECT"), os.Getenv("VELERO_RESTIC_RESTORE_HELPER_REPO"), os.Getenv("VELERO_RESTIC_RESTORE_HELPER_TAG")),
2156+
"image": os.Getenv("RELATED_IMAGE_VELERO_RESTIC_RESTORE_HELPER"),
21582157
},
21592158
},
21602159
},

controllers/velero.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,10 @@ func getVeleroImage(dpa *oadpv1alpha1.DataProtectionApplication) string {
636636
if dpa.Spec.UnsupportedOverrides[oadpv1alpha1.VeleroImageKey] != "" {
637637
return dpa.Spec.UnsupportedOverrides[oadpv1alpha1.VeleroImageKey]
638638
}
639-
if os.Getenv("VELERO_REPO") == "" {
639+
if os.Getenv("RELATED_IMAGE_VELERO") == "" {
640640
return common.VeleroImage
641641
}
642-
return fmt.Sprintf("%v/%v/%v:%v", os.Getenv("REGISTRY"), os.Getenv("PROJECT"), os.Getenv("VELERO_REPO"), os.Getenv("VELERO_TAG"))
642+
return os.Getenv("RELATED_IMAGE_VELERO")
643643
}
644644

645645
func (r *DPAReconciler) getDpaAppLabels(dpa *oadpv1alpha1.DataProtectionApplication) map[string]string {

0 commit comments

Comments
 (0)