Skip to content

[BUG] Different Namespaces in DR Breaks PVC Sync #5

@mattmattox

Description

@mattmattox

Description

When setting destinationNamespace to a value different from sourceNamespace, the PVC sync fails because the controller is unable to locate the PVC in the destination namespace.

Error Logs

level=error msg="[DR-SYNC-ERROR] Failed to get PVC" error="PersistentVolumeClaim \"test-vol\" not found" namespace=helloworld-dr
level=error msg="[DR-SYNC-ERROR] Failed to get PVC with direct API client too" error="persistentvolumeclaims \"test-vol\" not found" namespace=helloworld-dr

Example Configuration

apiVersion: dr-syncer.io/v1alpha1
kind: NamespaceMapping
metadata:
  name: hello-world
  namespace: dr-syncer
spec:
  clusterMappingRef:
    name: staging-shared-to-hot-dr
    namespace: dr-syncer
  destinationNamespace: helloworld-dr
  immutableResourceConfig:
    defaultHandling: Recreate
    drainTimeout: 5m0s
    forceDeleteTimeout: 2m0s
  paused: false
  pvcConfig:
    dataSyncConfig:
      concurrentSyncs: 1
      rsyncOptions:
        - "--archive"
        - "--human-readable"
      timeout: 5m
    preserveVolumeAttributes: false
    storageClassMappings:
      - from: do-block-storage-xfs
        to: do-block-storage-xfs
      - from: do-block-storage
        to: do-block-storage
    syncData: true
    syncPersistentVolumes: false
  replicationMode: Scheduled
  resourceTypes:
    - PersistentVolumeClaims
    - Deployments
  scaleToZero: true
  schedule: "* * * * *"
  sourceNamespace: helloworld
  syncCRDs: false

Expected Behavior

The controller should correctly locate and sync PVCs between different namespaces as specified in the NamespaceMapping configuration.

Steps to Reproduce

  1. Configure a NamespaceMapping with different sourceNamespace and destinationNamespace.
  2. Trigger a sync operation.
  3. Observe the error logs indicating the PVC is not found in the destination namespace.

Possible Fix

The controller may need an update to properly reference the source PVC and map it correctly to the destination namespace.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions