From aee385a67d1b0b7b803b5f18cfc43ebbc1629e74 Mon Sep 17 00:00:00 2001 From: Jean-Marc ANDRE Date: Tue, 1 Dec 2020 21:34:36 +0100 Subject: [PATCH] New status fields for BackupSession --- api/v1alpha1/backupsession_types.go | 17 +++++++++++++++++ api/v1alpha1/zz_generated.deepcopy.go | 10 +++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/backupsession_types.go b/api/v1alpha1/backupsession_types.go index 892f77c..8f54ca6 100644 --- a/api/v1alpha1/backupsession_types.go +++ b/api/v1alpha1/backupsession_types.go @@ -23,6 +23,15 @@ import ( // 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. +type BackupSessionState string + +const ( + New BackupSessionState = "New" + Starting BackupSessionState = "Starting" + Running BackupSessionState = "Running" + Done BackupSessionState = "Done" +) + type Ref struct { Name string `json:"name"` } @@ -40,6 +49,14 @@ type BackupSessionSpec struct { type BackupSessionStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // 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 diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 3d5f46f..9605aa1 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -164,7 +164,7 @@ func (in *BackupSession) DeepCopyInto(out *BackupSession) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) 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. @@ -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. func (in *BackupSessionStatus) DeepCopyInto(out *BackupSessionStatus) { *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.