Skip to content

Commit

Permalink
Merge pull request #429 from raghavendra-talur/rtalur-backport-997-2
Browse files Browse the repository at this point in the history
BUG DFBUGS-997: Backport fixes for check hooks
  • Loading branch information
ShyamsundarR authored Dec 26, 2024
2 parents 811d6d4 + b6b9ca5 commit 1fd8bf8
Show file tree
Hide file tree
Showing 23 changed files with 439 additions and 103 deletions.
1 change: 1 addition & 0 deletions e2e/dractions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func EnableProtection(w workloads.Workload, d deployers.Deployer) error {
if placement.Annotations == nil {
placement.Annotations = make(map[string]string)
}

placement.Annotations[OcmSchedulingDisable] = "true"

return updatePlacement(util.Ctx.Hub.CtrlClient, placement)
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cel/cel_drclusters_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cel_test

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cel/cel_drplacementcontrol_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cel_test

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cel/cel_drpolicy_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cel_test

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cephfscg/cephfscg_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg_test

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cephfscg/cghandler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cephfscg/cghandler_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg_test

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cephfscg/replicationgroupdestination.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg_test

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cephfscg/replicationgroupsource.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cephfscg/replicationgroupsource_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg_test

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cephfscg/utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cephfscg/volumegroupsourcehandler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg

import (
Expand Down
7 changes: 7 additions & 0 deletions internal/controller/cephfscg/volumegroupsourcehandler_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package cephfscg_test

import (
Expand Down Expand Up @@ -211,13 +214,15 @@ func CreateRS(rsName string) {
func UpdateRS(rsName string) {
retryErr := retry.RetryOnConflict(retry.DefaultBackoff, func() error {
rs := &volsyncv1alpha1.ReplicationSource{}

err := k8sClient.Get(context.TODO(), types.NamespacedName{
Name: rsName,
Namespace: "default",
}, rs)
if err != nil {
return err
}

rs.Status = &volsyncv1alpha1.ReplicationSourceStatus{
LastManualSync: manualString,
}
Expand Down Expand Up @@ -249,13 +254,15 @@ func GenerateReplicationGroupSource(
func UpdateVGS(rgs *v1alpha1.ReplicationGroupSource, vsName, pvcName string) {
retryErr := retry.RetryOnConflict(retry.DefaultBackoff, func() error {
volumeGroupSnapshot := &vgsv1alphfa1.VolumeGroupSnapshot{}

err := k8sClient.Get(context.TODO(), types.NamespacedName{
Name: fmt.Sprintf(cephfscg.VolumeGroupSnapshotNameFormat, rgs.Name),
Namespace: rgs.Namespace,
}, volumeGroupSnapshot)
if err != nil {
return err
}

ready := true
volumeGroupSnapshot.Status = &vgsv1alphfa1.VolumeGroupSnapshotStatus{
ReadyToUse: &ready,
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/drplacementcontrol_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,6 @@ func getVRGsFromManagedClusters(
vrgs := map[string]*rmn.VolumeReplicationGroup{}

annotations := make(map[string]string)

annotations[DRPCNameAnnotation] = drpc.Name
annotations[DRPCNamespaceAnnotation] = drpc.Namespace

Expand All @@ -1144,6 +1143,7 @@ func getVRGsFromManagedClusters(
// Only NotFound error is accepted
if errors.IsNotFound(err) {
log.Info(fmt.Sprintf("VRG not found on %q", drCluster.Name))

numClustersQueriedSuccessfully++

continue
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/util/cephfs_cg.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package util

import (
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/util/cephfs_cg_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: The RamenDR authors
// SPDX-License-Identifier: Apache-2.0

package util_test

import (
Expand Down
Loading

0 comments on commit 1fd8bf8

Please sign in to comment.