New status fields for BackupSession

This commit is contained in:
Jean-Marc ANDRE 2020-12-01 21:34:36 +01:00
parent 82277d70c0
commit aee385a67d
2 changed files with 26 additions and 1 deletions

View File

@ -23,6 +23,15 @@ import (
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
type BackupSessionState string
const (
New BackupSessionState = "New"
Starting BackupSessionState = "Starting"
Running BackupSessionState = "Running"
Done BackupSessionState = "Done"
)
type Ref struct { type Ref struct {
Name string `json:"name"` Name string `json:"name"`
} }
@ -40,6 +49,14 @@ type BackupSessionSpec struct {
type BackupSessionStatus struct { type BackupSessionStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file // Important: Run "make" to regenerate code after modifying this file
// +optional
BackupSessionState `json:"state,omitempty"`
// +optional
SnapshotId string `json:"snapshotId,omitempty"`
// +optional
StartTime *metav1.Time `json:"startTime,omitempty"`
// +optional
EndTime *metav1.Time `json:"endTime,omitempty"`
} }
// +kubebuilder:object:root=true // +kubebuilder:object:root=true

View File

@ -164,7 +164,7 @@ func (in *BackupSession) DeepCopyInto(out *BackupSession) {
out.TypeMeta = in.TypeMeta out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec out.Spec = in.Spec
out.Status = in.Status in.Status.DeepCopyInto(&out.Status)
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSession. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSession.
@ -236,6 +236,14 @@ func (in *BackupSessionSpec) DeepCopy() *BackupSessionSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *BackupSessionStatus) DeepCopyInto(out *BackupSessionStatus) { func (in *BackupSessionStatus) DeepCopyInto(out *BackupSessionStatus) {
*out = *in *out = *in
if in.StartTime != nil {
in, out := &in.StartTime, &out.StartTime
*out = (*in).DeepCopy()
}
if in.EndTime != nil {
in, out := &in.EndTime, &out.EndTime
*out = (*in).DeepCopy()
}
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSessionStatus. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSessionStatus.