From dfad6516e3449738abb803f06610ef07cd7e84a8 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Tue, 19 Aug 2025 14:07:19 -0500 Subject: [PATCH 1/2] feat: add support for Hypershift plugin in OADP 1.4 Signed-off-by: Tiger Kaovilai --- api/v1alpha1/oadp_types.go | 5 ++++- .../oadp-operator.clusterserviceversion.yaml | 4 ++++ ...penshift.io_dataprotectionapplications.yaml | 10 ++-------- ...penshift.io_dataprotectionapplications.yaml | 10 ++-------- config/manager/manager.yaml | 2 ++ pkg/common/common.go | 18 ++++++++++-------- pkg/credentials/credentials.go | 17 +++++++++++++++++ 7 files changed, 41 insertions(+), 25 deletions(-) diff --git a/api/v1alpha1/oadp_types.go b/api/v1alpha1/oadp_types.go index efa1832388b..f4ea6078897 100644 --- a/api/v1alpha1/oadp_types.go +++ b/api/v1alpha1/oadp_types.go @@ -35,7 +35,7 @@ const ReconcileCompleteMessage = "Reconcile complete" const OadpOperatorLabel = "openshift.io/oadp" const RegistryDeploymentLabel = "openshift.io/oadp-registry" -// +kubebuilder:validation:Enum=aws;legacy-aws;gcp;azure;csi;vsm;openshift;kubevirt +// +kubebuilder:validation:Enum=aws;legacy-aws;gcp;azure;csi;vsm;openshift;kubevirt;hypershift type DefaultPlugin string const DefaultPluginAWS DefaultPlugin = "aws" @@ -46,6 +46,7 @@ const DefaultPluginCSI DefaultPlugin = "csi" const DefaultPluginVSM DefaultPlugin = "vsm" const DefaultPluginOpenShift DefaultPlugin = "openshift" const DefaultPluginKubeVirt DefaultPlugin = "kubevirt" +const DefaultPluginHypershift DefaultPlugin = "hypershift" type CustomPlugin struct { Name string `json:"name"` @@ -63,6 +64,7 @@ const AzurePluginImageKey UnsupportedImageKey = "azurePluginImageFqin" const GCPPluginImageKey UnsupportedImageKey = "gcpPluginImageFqin" const ResticRestoreImageKey UnsupportedImageKey = "resticRestoreImageFqin" const KubeVirtPluginImageKey UnsupportedImageKey = "kubevirtPluginImageFqin" +const HypershiftPluginImageKey UnsupportedImageKey = "hypershiftPluginImageFqin" const OperatorTypeKey UnsupportedImageKey = "operator-type" const OperatorTypeMTC = "mtc" @@ -353,6 +355,7 @@ type DataProtectionApplicationSpec struct { // - gcpPluginImageFqin // - resticRestoreImageFqin // - kubevirtPluginImageFqin + // - hypershiftPluginImageFqin // - operator-type // +optional UnsupportedOverrides map[UnsupportedImageKey]string `json:"unsupportedOverrides,omitempty"` diff --git a/bundle/manifests/oadp-operator.clusterserviceversion.yaml b/bundle/manifests/oadp-operator.clusterserviceversion.yaml index 6cd2090c81e..aebdeb564e2 100644 --- a/bundle/manifests/oadp-operator.clusterserviceversion.yaml +++ b/bundle/manifests/oadp-operator.clusterserviceversion.yaml @@ -866,6 +866,8 @@ spec: value: quay.io/konveyor/velero-plugin-for-gcp:oadp-1.4 - name: RELATED_IMAGE_KUBEVIRT_VELERO_PLUGIN value: quay.io/konveyor/kubevirt-velero-plugin:v0.7.0 + - name: RELATED_IMAGE_HYPERSHIFT_VELERO_PLUGIN + value: quay.io/redhat-user-workloads/ocp-art-tenant/oadp-hypershift-oadp-plugin-oadp-1-4 - name: RELATED_IMAGE_MUSTGATHER value: registry.redhat.io/oadp/oadp-mustgather-rhel8:v1.2 image: quay.io/konveyor/oadp-operator:oadp-1.4 @@ -1017,6 +1019,8 @@ spec: name: velero-plugin-for-gcp - image: quay.io/konveyor/kubevirt-velero-plugin:v0.7.0 name: kubevirt-velero-plugin + - image: quay.io/redhat-user-workloads/ocp-art-tenant/oadp-hypershift-oadp-plugin-oadp-1-4 + name: hypershift-velero-plugin - image: registry.redhat.io/oadp/oadp-mustgather-rhel8:v1.2 name: mustgather version: 1.4.0 diff --git a/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml b/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml index 28e3e771d47..793b39495a7 100644 --- a/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml +++ b/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml @@ -131,12 +131,8 @@ spec: description: The key of the secret to select from. Must be a valid secret key. type: string name: - default: "" description: |- Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: @@ -824,6 +820,7 @@ spec: - vsm - openshift - kubevirt + - hypershift type: string type: array defaultSnapshotMoveData: @@ -1278,12 +1275,8 @@ spec: description: The key of the secret to select from. Must be a valid secret key. type: string name: - default: "" description: |- Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: @@ -1317,6 +1310,7 @@ spec: - gcpPluginImageFqin - resticRestoreImageFqin - kubevirtPluginImageFqin + - hypershiftPluginImageFqin - operator-type type: object required: diff --git a/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml b/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml index e9e63c2c01d..71ff673d9d0 100644 --- a/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml +++ b/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml @@ -131,12 +131,8 @@ spec: description: The key of the secret to select from. Must be a valid secret key. type: string name: - default: "" description: |- Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: @@ -824,6 +820,7 @@ spec: - vsm - openshift - kubevirt + - hypershift type: string type: array defaultSnapshotMoveData: @@ -1278,12 +1275,8 @@ spec: description: The key of the secret to select from. Must be a valid secret key. type: string name: - default: "" description: |- Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: @@ -1317,6 +1310,7 @@ spec: - gcpPluginImageFqin - resticRestoreImageFqin - kubevirtPluginImageFqin + - hypershiftPluginImageFqin - operator-type type: object required: diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 7624d085090..fbde35999a3 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -58,6 +58,8 @@ spec: value: quay.io/konveyor/velero-plugin-for-gcp:oadp-1.4 - name: RELATED_IMAGE_KUBEVIRT_VELERO_PLUGIN value: quay.io/konveyor/kubevirt-velero-plugin:v0.7.0 + - name: RELATED_IMAGE_HYPERSHIFT_VELERO_PLUGIN + value: quay.io/redhat-user-workloads/ocp-art-tenant/oadp-hypershift-oadp-plugin-oadp-1-4 - name: RELATED_IMAGE_MUSTGATHER value: registry.redhat.io/oadp/oadp-mustgather-rhel8:v1.2 args: diff --git a/pkg/common/common.go b/pkg/common/common.go index 310c0e0dda6..73c47dedf9d 100644 --- a/pkg/common/common.go +++ b/pkg/common/common.go @@ -61,14 +61,15 @@ var DefaultRestoreResourcePriorities = restore.Priorities{ // Images const ( - VeleroImage = "quay.io/konveyor/velero:latest" - OpenshiftPluginImage = "quay.io/konveyor/openshift-velero-plugin:latest" - AWSPluginImage = "quay.io/konveyor/velero-plugin-for-aws:latest" - LegacyAWSPluginImage = "quay.io/konveyor/velero-plugin-for-legacy-aws:latest" - AzurePluginImage = "quay.io/konveyor/velero-plugin-for-microsoft-azure:latest" - GCPPluginImage = "quay.io/konveyor/velero-plugin-for-gcp:latest" - RegistryImage = "quay.io/konveyor/registry:latest" - KubeVirtPluginImage = "quay.io/konveyor/kubevirt-velero-plugin:v0.7.0" + VeleroImage = "quay.io/konveyor/velero:latest" + OpenshiftPluginImage = "quay.io/konveyor/openshift-velero-plugin:latest" + AWSPluginImage = "quay.io/konveyor/velero-plugin-for-aws:latest" + LegacyAWSPluginImage = "quay.io/konveyor/velero-plugin-for-legacy-aws:latest" + AzurePluginImage = "quay.io/konveyor/velero-plugin-for-microsoft-azure:latest" + GCPPluginImage = "quay.io/konveyor/velero-plugin-for-gcp:latest" + RegistryImage = "quay.io/konveyor/registry:latest" + KubeVirtPluginImage = "quay.io/konveyor/kubevirt-velero-plugin:v0.7.0" + HypershiftPluginImage = "quay.io/redhat-user-workloads/ocp-art-tenant/oadp-hypershift-oadp-plugin-oadp-1-4" ) // Plugin names @@ -79,6 +80,7 @@ const ( VeleroPluginForGCP = "velero-plugin-for-gcp" VeleroPluginForOpenshift = "openshift-velero-plugin" KubeVirtPlugin = "kubevirt-velero-plugin" + HypershiftPlugin = "hypershift-oadp-plugin" ) // Environment Vars keys diff --git a/pkg/credentials/credentials.go b/pkg/credentials/credentials.go index 9062f9a3341..9d34c055330 100644 --- a/pkg/credentials/credentials.go +++ b/pkg/credentials/credentials.go @@ -78,6 +78,10 @@ var ( IsCloudProvider: false, PluginName: common.KubeVirtPlugin, }, + oadpv1alpha1.DefaultPluginHypershift: { + IsCloudProvider: false, + PluginName: common.HypershiftPlugin, + }, } ) @@ -159,6 +163,16 @@ func getKubeVirtPluginImage(dpa *oadpv1alpha1.DataProtectionApplication) string return os.Getenv("RELATED_IMAGE_KUBEVIRT_VELERO_PLUGIN") } +func getHypershiftPluginImage(dpa *oadpv1alpha1.DataProtectionApplication) string { + if dpa.Spec.UnsupportedOverrides[oadpv1alpha1.HypershiftPluginImageKey] != "" { + return dpa.Spec.UnsupportedOverrides[oadpv1alpha1.HypershiftPluginImageKey] + } + if os.Getenv("RELATED_IMAGE_HYPERSHIFT_VELERO_PLUGIN") == "" { + return common.HypershiftPluginImage + } + return os.Getenv("RELATED_IMAGE_HYPERSHIFT_VELERO_PLUGIN") +} + func GetPluginImage(defaultPlugin oadpv1alpha1.DefaultPlugin, dpa *oadpv1alpha1.DataProtectionApplication) string { switch defaultPlugin { @@ -179,6 +193,9 @@ func GetPluginImage(defaultPlugin oadpv1alpha1.DefaultPlugin, dpa *oadpv1alpha1. case oadpv1alpha1.DefaultPluginKubeVirt: return getKubeVirtPluginImage(dpa) + + case oadpv1alpha1.DefaultPluginHypershift: + return getHypershiftPluginImage(dpa) } return "" } From 777849701c281fa2050db0c952a594a068708030 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Thu, 21 Aug 2025 16:33:25 -0500 Subject: [PATCH 2/2] Be happy CI. I ran `make bundle` after first running `git submodule update --init --recursive` Signed-off-by: Tiger Kaovilai --- .../oadp.openshift.io_dataprotectionapplications.yaml | 8 ++++++++ .../oadp.openshift.io_dataprotectionapplications.yaml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml b/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml index 793b39495a7..b0f02fb0165 100644 --- a/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml +++ b/bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml @@ -131,8 +131,12 @@ spec: description: The key of the secret to select from. Must be a valid secret key. type: string name: + default: "" description: |- Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: @@ -1275,8 +1279,12 @@ spec: description: The key of the secret to select from. Must be a valid secret key. type: string name: + default: "" description: |- Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: diff --git a/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml b/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml index 71ff673d9d0..65ac1262635 100644 --- a/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml +++ b/config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml @@ -131,8 +131,12 @@ spec: description: The key of the secret to select from. Must be a valid secret key. type: string name: + default: "" description: |- Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: @@ -1275,8 +1279,12 @@ spec: description: The key of the secret to select from. Must be a valid secret key. type: string name: + default: "" description: |- Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: