Skip to content

Commit dc0cc1e

Browse files
committed
WIP
Signed-off-by: Michal Pryc <[email protected]>
1 parent 8750214 commit dc0cc1e

16 files changed

+786
-223
lines changed

api/v1alpha1/oadp_types.go

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ type PodConfig struct {
115115
// labels to add to pods
116116
// +optional
117117
Labels map[string]string `json:"labels,omitempty"`
118-
// nodeSelector defines the nodeSelector to be supplied to Restic podSpec
118+
// nodeSelector defines the nodeSelector to be supplied to NodeAgent podSpec
119119
// +optional
120120
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
121-
// tolerations defines the list of tolerations to be applied to Restic daemonset
121+
// tolerations defines the list of tolerations to be applied to NodeAgent daemonset
122122
// +optional
123123
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
124-
// resourceAllocations defines the CPU and Memory resource allocations for the restic Pod
124+
// resourceAllocations defines the CPU and Memory resource allocations for the NodeAgent Pod
125125
// +optional
126126
// +nullable
127127
ResourceAllocations corev1.ResourceRequirements `json:"resourceAllocations,omitempty"`
@@ -130,26 +130,53 @@ type PodConfig struct {
130130
Env []corev1.EnvVar `json:"env,omitempty"`
131131
}
132132

133-
// ResticConfig is the configuration for restic server
134-
type ResticConfig struct {
133+
type NodeAgentCommonFields struct {
135134
// enable defines a boolean pointer whether we want the daemonset to
136135
// exist or not
137136
// +optional
138137
Enable *bool `json:"enable,omitempty"`
139-
// supplementalGroups defines the linux groups to be applied to the Restic Pod
138+
// supplementalGroups defines the linux groups to be applied to the NodeAgent Pod
140139
// +optional
141140
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
142-
// timeout defines the Restic timeout, default value is 1h
141+
// timeout defines the NodeAgent timeout, default value is 1h
143142
// +optional
144143
Timeout string `json:"timeout,omitempty"`
145144
// Pod specific configuration
146145
PodConfig *PodConfig `json:"podConfig,omitempty"`
147146
}
148147

148+
// NodeAgentConfig is the configuration for node server
149+
type NodeAgentConfig struct {
150+
// Embedding NodeAgentCommonFields
151+
// +optional
152+
NodeAgentCommonFields `json:",inline"`
153+
154+
// The type of uploader to transfer the data of pod volumes, the supported values are 'restic' or 'kopia'
155+
// +kubebuilder:validation:Enum=restic;kopia
156+
// +kubebuilder:validation:Required
157+
UploaderType string `json:"uploaderType"`
158+
}
159+
160+
// ResticConfig is the configuration for restic server
161+
type ResticConfig struct {
162+
// Embedding NodeAgentCommonFields
163+
// +optional
164+
NodeAgentCommonFields `json:",inline"`
165+
}
166+
149167
// ApplicationConfig defines the configuration for the Data Protection Application
150168
type ApplicationConfig struct {
151169
Velero *VeleroConfig `json:"velero,omitempty"`
170+
// (deprecation warning) ResticConfig is the configuration for restic server.
171+
// Restic is for backwards compatibility and is replaced by the nodeAgentConfig
172+
// Restic will be removed with the OADP 1.4
173+
// +kubebuilder:deprecatedversion:warning=1.3
174+
// +optional
152175
Restic *ResticConfig `json:"restic,omitempty"`
176+
177+
// NodeAgent is needed to allow selection between kopia or restic
178+
// +optional
179+
NodeAgent *NodeAgentConfig `json:"nodeAgentConfig,omitempty"`
153180
}
154181

155182
type CloudStorageLocation struct {
@@ -269,7 +296,7 @@ type VolumeOptions struct {
269296
// the data mover cache volume
270297
//+optional
271298
CacheStorageClassName string `json:"cacheStorageClassName,omitempty"`
272-
// cacheCapacity determines the size of the restic metadata cache volume
299+
// cacheCapacity determines the size of the nodeAgent metadata cache volume
273300
//+optional
274301
CacheCapacity string `json:"cacheCapacity,omitempty"`
275302
// cacheAccessMode is the access mode to be used to provision the cache volume
@@ -388,11 +415,15 @@ func (dpa *DataProtectionApplication) AutoCorrect() {
388415
if dpa.Spec.Configuration.Velero.Args != nil {
389416
// if args is not nil, we take care of some fields that will be overridden from dpa if not specified in args
390417
// Enable user to specify --fs-backup-timeout duration (OADP default 1h0m0s)
391-
resticTimeout := "1h"
392-
if dpa.Spec.Configuration != nil && dpa.Spec.Configuration.Restic != nil && len(dpa.Spec.Configuration.Restic.Timeout) > 0 {
393-
resticTimeout = dpa.Spec.Configuration.Restic.Timeout
418+
fsBackupTimeout := "1h"
419+
if dpa.Spec.Configuration != nil {
420+
if dpa.Spec.Configuration.NodeAgent != nil && len(dpa.Spec.Configuration.NodeAgent.Timeout) > 0 {
421+
fsBackupTimeout = dpa.Spec.Configuration.NodeAgent.Timeout
422+
} else if dpa.Spec.Configuration.Restic != nil && len(dpa.Spec.Configuration.Restic.Timeout) > 0 {
423+
fsBackupTimeout = dpa.Spec.Configuration.Restic.Timeout
424+
}
394425
}
395-
if pvOperationTimeout, err := time.ParseDuration(resticTimeout); err == nil && dpa.Spec.Configuration.Velero.Args.PodVolumeOperationTimeout == nil {
426+
if pvOperationTimeout, err := time.ParseDuration(fsBackupTimeout); err == nil && dpa.Spec.Configuration.Velero.Args.PodVolumeOperationTimeout == nil {
396427
dpa.Spec.Configuration.Velero.Args.PodVolumeOperationTimeout = &pvOperationTimeout
397428
}
398429
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 52 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/Dockerfile.bundle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=oadp-operator
88
LABEL operators.operatorframework.io.bundle.channels.v1=stable
99
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
10-
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.23.0
10+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.1
1111
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1212
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
1313

bundle.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=oadp-operator
88
LABEL operators.operatorframework.io.bundle.channels.v1=stable
99
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
10-
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.23.0
10+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.1
1111
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1212
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
1313

bundle/manifests/oadp-operator.clusterserviceversion.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ metadata:
3232
}
3333
],
3434
"configuration": {
35-
"restic": {
36-
"enable": true
35+
"nodeAgentConfig": {
36+
"enable": true,
37+
"uploaderType": "restic"
3738
},
3839
"velero": {
3940
"defaultPlugins": [
@@ -151,15 +152,15 @@ metadata:
151152
categories: OpenShift Optional
152153
certified: "false"
153154
containerImage: quay.io/konveyor/oadp-operator:latest
154-
createdAt: "2020-09-08T12:21:00Z"
155+
createdAt: "2023-08-01T17:03:41Z"
155156
description: OADP (OpenShift API for Data Protection) operator sets up and installs
156157
Data Protection Applications on the OpenShift platform.
157158
olm.skipRange: '>=0.0.0 <99.0.0'
158159
operatorframework.io/suggested-namespace: openshift-adp
159160
operators.openshift.io/infrastructure-features: '["Disconnected"]'
160161
operators.openshift.io/valid-subscription: '["OpenShift Container Platform", "OpenShift
161162
Platform Plus"]'
162-
operators.operatorframework.io/builder: operator-sdk-v1.23.0
163+
operators.operatorframework.io/builder: operator-sdk-v1.28.1
163164
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
164165
repository: https://github.com/openshift/oadp-operator
165166
support: Red Hat

0 commit comments

Comments
 (0)