@@ -118,7 +118,7 @@ type PodConfig struct {
118
118
// nodeSelector defines the nodeSelector to be supplied to podSpec
119
119
// +optional
120
120
NodeSelector map [string ]string `json:"nodeSelector,omitempty"`
121
- // tolerations defines the list of tolerations to be applied
121
+ // tolerations defines the list of tolerations to be applied to daemonset
122
122
// +optional
123
123
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
124
124
// resourceAllocations defines the CPU and Memory resource allocations for the Pod
@@ -130,26 +130,53 @@ type PodConfig struct {
130
130
Env []corev1.EnvVar `json:"env,omitempty"`
131
131
}
132
132
133
- // ResticConfig is the configuration for restic server
134
- type ResticConfig struct {
133
+ type NodeAgentCommonFields struct {
135
134
// enable defines a boolean pointer whether we want the daemonset to
136
135
// exist or not
137
136
// +optional
138
137
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
140
139
// +optional
141
140
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
143
142
// +optional
144
143
Timeout string `json:"timeout,omitempty"`
145
144
// Pod specific configuration
146
145
PodConfig * PodConfig `json:"podConfig,omitempty"`
147
146
}
148
147
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
+
149
167
// ApplicationConfig defines the configuration for the Data Protection Application
150
168
type ApplicationConfig struct {
151
169
Velero * VeleroConfig `json:"velero,omitempty"`
170
+ // (deprecation warning) ResticConfig is the configuration for restic DaemonSet.
171
+ // restic is for backwards compatibility and is replaced by the nodeAgent
172
+ // restic will be removed with the OADP 1.4
173
+ // +kubebuilder:deprecatedversion:warning=1.3
174
+ // +optional
152
175
Restic * ResticConfig `json:"restic,omitempty"`
176
+
177
+ // NodeAgent is needed to allow selection between kopia or restic
178
+ // +optional
179
+ NodeAgent * NodeAgentConfig `json:"nodeAgent,omitempty"`
153
180
}
154
181
155
182
type CloudStorageLocation struct {
@@ -388,11 +415,15 @@ func (dpa *DataProtectionApplication) AutoCorrect() {
388
415
if dpa .Spec .Configuration .Velero .Args != nil {
389
416
// if args is not nil, we take care of some fields that will be overridden from dpa if not specified in args
390
417
// 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
+ }
394
425
}
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 {
396
427
dpa .Spec .Configuration .Velero .Args .PodVolumeOperationTimeout = & pvOperationTimeout
397
428
}
398
429
}
0 commit comments