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