From 7b77e0b8bf040ecffd63f96c4beef1acfad4075d Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Thu, 6 Jun 2024 07:21:24 -0400 Subject: [PATCH] drpc: add ramenconfig field to enable volsync support for discovered apps Add a configuration option that keeps volsync support for discovered apps disabled until the feature is well tested. Signed-off-by: Raghavendra Talur --- api/v1alpha1/ramenconfig_types.go | 3 ++- controllers/drplacementcontrol_controller.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/ramenconfig_types.go b/api/v1alpha1/ramenconfig_types.go index 879b8b575..4ff2254cd 100644 --- a/api/v1alpha1/ramenconfig_types.go +++ b/api/v1alpha1/ramenconfig_types.go @@ -147,7 +147,8 @@ type RamenConfig struct { MultiNamespace struct { // Enables feature to protect resources in namespaces other than VRG's - FeatureEnabled bool `json:"FeatureEnabled,omitempty"` + FeatureEnabled bool `json:"FeatureEnabled,omitempty"` + VolsyncSupported bool `json:"volsyncSupported,omitempty"` } `json:"multiNamespace,omitempty"` // Unprotect deleted or deselected PVCs diff --git a/controllers/drplacementcontrol_controller.go b/controllers/drplacementcontrol_controller.go index 346e8561f..8dd356ad4 100644 --- a/controllers/drplacementcontrol_controller.go +++ b/controllers/drplacementcontrol_controller.go @@ -976,6 +976,10 @@ func (r *DRPlacementControlReconciler) createDRPCInstance( log.Info("volsync is set to disabled") } + if !d.volSyncDisabled && drpcInAdminNamespace(drpc, ramenConfig) { + d.volSyncDisabled = !ramenConfig.MultiNamespace.VolsyncSupported + } + // Save the instance status d.instance.Status.DeepCopyInto(&d.savedInstanceStatus)