More refined status
This commit is contained in:
parent
3aaf127e58
commit
7702b69199
@ -30,17 +30,17 @@ type Repository struct {
|
||||
}
|
||||
|
||||
type Step struct {
|
||||
Name string `json:"name"`
|
||||
Env []corev1.EnvVar `json:"env"`
|
||||
Name string `json:"name"`
|
||||
Namespace string `json:"namespace"`
|
||||
Env []corev1.EnvVar `json:"env"`
|
||||
}
|
||||
|
||||
type Target struct {
|
||||
Kind string `json:"kind"`
|
||||
Name string `json:"name"`
|
||||
// +optional
|
||||
ApiVersion string `json:"apiVersion,omitempty"`
|
||||
// +optional
|
||||
Name string `json:"name,omitempty"`
|
||||
// +optional
|
||||
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
|
||||
// +optional
|
||||
Paths []string `json:"paths,omitempty"`
|
||||
|
||||
@ -23,12 +23,12 @@ 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
|
||||
type BackupState string
|
||||
|
||||
const (
|
||||
Running BackupSessionState = "Running"
|
||||
Success BackupSessionState = "Success"
|
||||
Failure BackupSessionState = "Failure"
|
||||
Running BackupState = "Running"
|
||||
Success BackupState = "Success"
|
||||
Failure BackupState = "Failure"
|
||||
)
|
||||
|
||||
type Ref struct {
|
||||
@ -44,12 +44,9 @@ type BackupSessionSpec struct {
|
||||
Ref `json:"ref"`
|
||||
}
|
||||
|
||||
// BackupSessionStatus defines the observed state of BackupSession
|
||||
type BackupSessionStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
type TargetStatus struct {
|
||||
// +optional
|
||||
BackupSessionState `json:"state,omitempty"`
|
||||
BackupState `json:"state,omitempty"`
|
||||
// +optional
|
||||
SnapshotId string `json:"snapshotId,omitempty"`
|
||||
// +optional
|
||||
@ -58,6 +55,18 @@ type BackupSessionStatus struct {
|
||||
Duration *metav1.Duration `json:"duration,omitempty"`
|
||||
}
|
||||
|
||||
// BackupSessionStatus defines the observed state of BackupSession
|
||||
type BackupSessionStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
// +optional
|
||||
BackupState `json:"state,omitempty"`
|
||||
// +optional
|
||||
StartTime *metav1.Time `json:"startTime,omitempty"`
|
||||
// +optional
|
||||
Targets []TargetStatus `json:"target,omitempty"`
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
|
||||
|
||||
@ -226,10 +226,12 @@ func (in *BackupSessionStatus) DeepCopyInto(out *BackupSessionStatus) {
|
||||
in, out := &in.StartTime, &out.StartTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.Duration != nil {
|
||||
in, out := &in.Duration, &out.Duration
|
||||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
if in.Targets != nil {
|
||||
in, out := &in.Targets, &out.Targets
|
||||
*out = make([]TargetStatus, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -506,3 +508,27 @@ func (in *Target) DeepCopy() *Target {
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TargetStatus) DeepCopyInto(out *TargetStatus) {
|
||||
*out = *in
|
||||
if in.StartTime != nil {
|
||||
in, out := &in.StartTime, &out.StartTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.Duration != nil {
|
||||
in, out := &in.Duration, &out.Duration
|
||||
*out = new(metav1.Duration)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetStatus.
|
||||
func (in *TargetStatus) DeepCopy() *TargetStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TargetStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user