Skip to content

Commit c5f87df

Browse files
OADP-599: Auto create s3 restic secrets for volsync from BSLs (#747)
* adding restic secret creation per bsl * Adding per bsl restic secret creation * fixing minor bugs * Adding owner ref * add crd bases changes * adding review feedback * feedback changes * adding review feedback * adding manifest changes * fixing typpo * adding checks * adding func to accomodate different s3 url style * Adding make bundle changes * Adding make bundle crd changes * Changing restic secret name to dm-credential * adding api changes * Move DM restic secret creation to reconcile batch and add other review feedback * adding DM feature conditional * Adding datamoverenable check func * fixing make bundle output issue * Adding bundle changes for vsb CR * adding more validations to restic secret check * edit restic secret desc in crd/bases & manifests
1 parent 925f578 commit c5f87df

10 files changed

+289
-19
lines changed

api/v1alpha1/oadp_types.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const ReconcileCompleteMessage = "Reconcile complete"
3131
const OadpOperatorLabel = "openshift.io/oadp"
3232
const RegistryDeploymentLabel = "openshift.io/oadp-registry"
3333
const DataMoverDeploymentLabel = "openshift.io/oadp-data-mover"
34+
const OadpBSLnameLabel = "openshift.io/oadp-bsl-name"
3435

3536
type DefaultPlugin string
3637

@@ -159,11 +160,21 @@ type SnapshotLocation struct {
159160
Velero *velero.VolumeSnapshotLocationSpec `json:"velero"`
160161
}
161162

163+
// DataMover defines the various config for DPA data mover
164+
type DataMover struct {
165+
// Enable flag is used to specify whether you want to deploy the volume snapshot mover controller
166+
// +optional
167+
Enable bool `json:"enable,omitempty"`
168+
// User supplied Restic Secret name
169+
// +optional
170+
CredentialName string `json:"credentialName,omitempty"`
171+
}
172+
162173
// Features defines the configuration for the DPA to enable the tech preview features
163174
type Features struct {
164-
// EnableDataMover is used to specify whether you want to deploy the volume snapshot mover controller and a modified csi datamover plugin
175+
// Contains data mover specific configurations
165176
// +optional
166-
EnableDataMover bool `json:"enableDataMover,omitempty"`
177+
DataMover *DataMover `json:"dataMover,omitempty"`
167178
}
168179

169180
// DataProtectionApplicationSpec defines the desired state of Velero

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/datamover.oadp.openshift.io_volumesnapshotbackups.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ spec:
4040
protectedNamespace:
4141
description: Namespace where the Velero deployment is present
4242
type: string
43+
resticSecretRef:
44+
description: Restic Secret reference for given BSL
45+
properties:
46+
name:
47+
description: Name of the BSL specific restic secret
48+
type: string
49+
type: object
4350
volumeSnapshotContent:
4451
description: 'ObjectReference contains enough information to let you
4552
inspect or modify the referred object. --- New uses of this type

bundle/manifests/oadp.openshift.io_dataprotectionapplications.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,17 @@ spec:
443443
description: Features defines the configuration for the DPA to enable
444444
the OADP tech preview features
445445
properties:
446-
enableDataMover:
447-
description: EnableDataMover is used to specify whether you want
448-
to deploy the volume snapshot mover controller and a modified
449-
csi datamover plugin
450-
type: boolean
446+
dataMover:
447+
description: Contains data mover specific configurations
448+
properties:
449+
credentialName:
450+
description: User supplied Restic Secret name
451+
type: string
452+
enable:
453+
description: Enable flag is used to specify whether you want
454+
to deploy the volume snapshot mover controller
455+
type: boolean
456+
type: object
451457
type: object
452458
podAnnotations:
453459
additionalProperties:

config/crd/bases/datamover.oadp.openshift.io_volumesnapshotbackups.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ spec:
4040
protectedNamespace:
4141
description: Namespace where the Velero deployment is present
4242
type: string
43+
resticSecretRef:
44+
description: Restic Secret reference for given BSL
45+
properties:
46+
name:
47+
description: Name of the BSL specific restic secret
48+
type: string
49+
type: object
4350
volumeSnapshotContent:
4451
description: 'ObjectReference contains enough information to let you
4552
inspect or modify the referred object. --- New uses of this type

config/crd/bases/oadp.openshift.io_dataprotectionapplications.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,17 @@ spec:
445445
description: Features defines the configuration for the DPA to enable
446446
the OADP tech preview features
447447
properties:
448-
enableDataMover:
449-
description: EnableDataMover is used to specify whether you want
450-
to deploy the volume snapshot mover controller and a modified
451-
csi datamover plugin
452-
type: boolean
448+
dataMover:
449+
description: Contains data mover specific configurations
450+
properties:
451+
credentialName:
452+
description: User supplied Restic Secret name
453+
type: string
454+
enable:
455+
description: Enable flag is used to specify whether you want
456+
to deploy the volume snapshot mover controller
457+
type: boolean
458+
type: object
453459
type: object
454460
podAnnotations:
455461
additionalProperties:

0 commit comments

Comments
 (0)