forked from k8up-io/k8up
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprebackuppod_types.go
46 lines (37 loc) · 1.28 KB
/
prebackuppod_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// PreBackupPodSpec define pods that will be launched during the backup. After the backup
// has finished (successfully or not), they should be removed again automatically
// by the operator.
type PreBackupPodSpec struct {
// BackupCommand will be added to the backupcommand annotation on the pod.
BackupCommand string `json:"backupCommand,omitempty"`
FileExtension string `json:"fileExtension,omitempty"`
// +kubebuilder:validation:Required
Pod *Pod `json:"pod,omitempty"`
}
// Pod is a dummy struct to fix some code generation issues.
type Pod struct {
corev1.PodTemplateSpec `json:",inline"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// PreBackupPod is the Schema for the prebackuppods API
type PreBackupPod struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PreBackupPodSpec `json:"spec,omitempty"`
}
// +kubebuilder:object:root=true
// PreBackupPodList contains a list of PreBackupPod
type PreBackupPodList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PreBackupPod `json:"items"`
}
func init() {
SchemeBuilder.Register(&PreBackupPod{}, &PreBackupPodList{})
}