Skip to content

Commit

Permalink
update VirtualMachineRestoreStatus object to include timestamp and error
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Henriksen <[email protected]>
  • Loading branch information
mhenriks committed Sep 10, 2020
1 parent 15f0b8d commit 422648d
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 4 deletions.
18 changes: 18 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10925,6 +10925,18 @@
}
}
},
"v1alpha1.VirtualMachineRestoreError": {
"description": "VirtualMachineRestoreError is the last error encountered while performing the restore",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"time": {
"$ref": "#/definitions/v1.Time"
}
}
},
"v1alpha1.VirtualMachineRestoreList": {
"description": "VirtualMachineRestoreList is a list of VirtualMachineRestore resources",
"type": "object",
Expand Down Expand Up @@ -10995,6 +11007,12 @@
"items": {
"$ref": "#/definitions/v1alpha1.VirtualMachineRestoreCondition"
}
},
"error": {
"$ref": "#/definitions/v1alpha1.VirtualMachineRestoreError"
},
"restoreTime": {
"$ref": "#/definitions/v1.Time"
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions pkg/virt-operator/creation/components/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ func NewVirtualMachineRestoreCrd() *extv1beta1.CustomResourceDefinition {
{Name: "TargetKind", Type: "string", JSONPath: ".spec.target.kind"},
{Name: "TargetName", Type: "string", JSONPath: ".spec.target.name"},
{Name: "Complete", Type: "boolean", JSONPath: ".status.complete"},
{Name: "RestoreTime", Type: "date", JSONPath: ".status.restoreTime"},
{Name: "Error", Type: "string", JSONPath: ".status.error.message"},
},
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions staging/src/kubevirt.io/client-go/apis/snapshot/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,28 @@ type VirtualMachineRestoreSpec struct {

// VirtualMachineRestoreStatus is the spec for a VirtualMachineRestoreresource
type VirtualMachineRestoreStatus struct {
// +optional
RestoreTime *metav1.Time `json:"restoreTime,omitempty"`

// +optional
Complete *bool `json:"complete,omitempty"`

// +optional
Error *VirtualMachineRestoreError `json:"error,omitempty"`

// +optional
Conditions []VirtualMachineRestoreCondition `json:"conditions,omitempty"`
}

// VirtualMachineRestoreError is the last error encountered while performing the restore
type VirtualMachineRestoreError struct {
// +optional
Time *metav1.Time `json:"time,omitempty"`

// +optional
Message *string `json:"message,omitempty"`
}

// VirtualMachineRestoreConditionType is the type of VirtualMachineRestoreCondition
type VirtualMachineRestoreConditionType string

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 422648d

Please sign in to comment.