@@ -119,7 +119,7 @@ type PodConfig struct {
119
119
// nodeSelector defines the nodeSelector to be supplied to podSpec
120
120
// +optional
121
121
NodeSelector map [string ]string `json:"nodeSelector,omitempty"`
122
- // tolerations defines the list of tolerations to be applied
122
+ // tolerations defines the list of tolerations to be applied to daemonset
123
123
// +optional
124
124
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
125
125
// resourceAllocations defines the CPU and Memory resource allocations for the Pod
@@ -131,26 +131,53 @@ type PodConfig struct {
131
131
Env []corev1.EnvVar `json:"env,omitempty"`
132
132
}
133
133
134
- // ResticConfig is the configuration for restic server
135
- type ResticConfig struct {
134
+ type NodeAgentCommonFields struct {
136
135
// enable defines a boolean pointer whether we want the daemonset to
137
136
// exist or not
138
137
// +optional
139
138
Enable * bool `json:"enable,omitempty"`
140
- // supplementalGroups defines the linux groups to be applied to the Restic Pod
139
+ // supplementalGroups defines the linux groups to be applied to the NodeAgent Pod
141
140
// +optional
142
141
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
143
- // timeout defines the Restic timeout, default value is 1h
142
+ // timeout defines the NodeAgent timeout, default value is 1h
144
143
// +optional
145
144
Timeout string `json:"timeout,omitempty"`
146
145
// Pod specific configuration
147
146
PodConfig * PodConfig `json:"podConfig,omitempty"`
148
147
}
149
148
149
+ // NodeAgentConfig is the configuration for node server
150
+ type NodeAgentConfig struct {
151
+ // Embedding NodeAgentCommonFields
152
+ // +optional
153
+ NodeAgentCommonFields `json:",inline"`
154
+
155
+ // The type of uploader to transfer the data of pod volumes, the supported values are 'restic' or 'kopia'
156
+ // +kubebuilder:validation:Enum=restic;kopia
157
+ // +kubebuilder:validation:Required
158
+ UploaderType string `json:"uploaderType"`
159
+ }
160
+
161
+ // ResticConfig is the configuration for restic server
162
+ type ResticConfig struct {
163
+ // Embedding NodeAgentCommonFields
164
+ // +optional
165
+ NodeAgentCommonFields `json:",inline"`
166
+ }
167
+
150
168
// ApplicationConfig defines the configuration for the Data Protection Application
151
169
type ApplicationConfig struct {
152
170
Velero * VeleroConfig `json:"velero,omitempty"`
171
+ // (deprecation warning) ResticConfig is the configuration for restic DaemonSet.
172
+ // restic is for backwards compatibility and is replaced by the nodeAgent
173
+ // restic will be removed with the OADP 1.4
174
+ // +kubebuilder:deprecatedversion:warning=1.3
175
+ // +optional
153
176
Restic * ResticConfig `json:"restic,omitempty"`
177
+
178
+ // NodeAgent is needed to allow selection between kopia or restic
179
+ // +optional
180
+ NodeAgent * NodeAgentConfig `json:"nodeAgent,omitempty"`
154
181
}
155
182
156
183
// CloudStorageLocation defines BackupStorageLocation using bucket referenced by CloudStorage CR.
@@ -400,11 +427,15 @@ func (dpa *DataProtectionApplication) AutoCorrect() {
400
427
if dpa .Spec .Configuration .Velero .Args != nil {
401
428
// if args is not nil, we take care of some fields that will be overridden from dpa if not specified in args
402
429
// Enable user to specify --fs-backup-timeout duration (OADP default 1h0m0s)
403
- resticTimeout := "1h"
404
- if dpa .Spec .Configuration != nil && dpa .Spec .Configuration .Restic != nil && len (dpa .Spec .Configuration .Restic .Timeout ) > 0 {
405
- resticTimeout = dpa .Spec .Configuration .Restic .Timeout
430
+ fsBackupTimeout := "1h"
431
+ if dpa .Spec .Configuration != nil {
432
+ if dpa .Spec .Configuration .NodeAgent != nil && len (dpa .Spec .Configuration .NodeAgent .Timeout ) > 0 {
433
+ fsBackupTimeout = dpa .Spec .Configuration .NodeAgent .Timeout
434
+ } else if dpa .Spec .Configuration .Restic != nil && len (dpa .Spec .Configuration .Restic .Timeout ) > 0 {
435
+ fsBackupTimeout = dpa .Spec .Configuration .Restic .Timeout
436
+ }
406
437
}
407
- if pvOperationTimeout , err := time .ParseDuration (resticTimeout ); err == nil && dpa .Spec .Configuration .Velero .Args .PodVolumeOperationTimeout == nil {
438
+ if pvOperationTimeout , err := time .ParseDuration (fsBackupTimeout ); err == nil && dpa .Spec .Configuration .Velero .Args .PodVolumeOperationTimeout == nil {
408
439
dpa .Spec .Configuration .Velero .Args .PodVolumeOperationTimeout = & pvOperationTimeout
409
440
}
410
441
}
0 commit comments