diff --git a/doc/plan.md b/doc/plan.md index ce4750a544c23527dbb36be2f084631ed8e8901b..f747c4cf7e1ab3af954af6e4448edac768ed007f 100644 --- a/doc/plan.md +++ b/doc/plan.md @@ -138,7 +138,7 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `conditions` _GenericCondition array_ | | | | +| `conditions` _GenericCondition array_ | `LatestResolved` indicates that the latest version as per the spec has been determined.<br />`Validated` indicates that the plan spec has been validated.<br />`Complete` indicates that the latest version of the plan has completed on all selected nodes. If any Jobs for the Plan fail to complete, this condition will remain false, and the reason and message will reflect the source of the error. | | | | `latestVersion` _string_ | The latest version, as resolved from .spec.version, or the channel server. | | | | `latestHash` _string_ | The hash of the most recently applied plan .spec. | | | | `applying` _string array_ | List of Node names that the Plan is currently being applied on. | | | diff --git a/pkg/apis/upgrade.cattle.io/v1/types.go b/pkg/apis/upgrade.cattle.io/v1/types.go index 5bdc1396b717cf696bca5b9918be06f7ad1bd744..58f4f323e087ce393b6e45ca8952d7b27015aa0f 100644 --- a/pkg/apis/upgrade.cattle.io/v1/types.go +++ b/pkg/apis/upgrade.cattle.io/v1/types.go @@ -27,6 +27,9 @@ var ( // +kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.spec.upgrade.image` // +kubebuilder:printcolumn:name="Channel",type=string,JSONPath=`.spec.channel` // +kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version` +// +kubebuilder:printcolumn:name="Complete",type=string,JSONPath=`.status.conditions[?(@.type=='Complete')].status` +// +kubebuilder:printcolumn:name="Message",type=string,JSONPath=`.status.conditions[?(@.message!='')].message` +// +kubebuilder:printcolumn:name="Applying",type=string,JSONPath=`.status.applying`,priority=10 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Plan represents a set of Jobs to apply an upgrade (or other operation) to set of Nodes. @@ -83,6 +86,9 @@ type PlanSpec struct { // PlanStatus represents the resulting state from processing Plan events. type PlanStatus struct { + // `LatestResolved` indicates that the latest version as per the spec has been determined. + // `Validated` indicates that the plan spec has been validated. + // `Complete` indicates that the latest version of the plan has completed on all selected nodes. If any Jobs for the Plan fail to complete, this condition will remain false, and the reason and message will reflect the source of the error. // +optional // +patchMergeKey=type // +patchStrategy=merge diff --git a/pkg/crds/yaml/generated/upgrade.cattle.io_plans.yaml b/pkg/crds/yaml/generated/upgrade.cattle.io_plans.yaml index ec741ed3698e71c8419c49f4990c1d80192e4369..e04535ffa173e1584e9f4531473279ae128c9181 100644 --- a/pkg/crds/yaml/generated/upgrade.cattle.io_plans.yaml +++ b/pkg/crds/yaml/generated/upgrade.cattle.io_plans.yaml @@ -24,6 +24,16 @@ spec: - jsonPath: .spec.version name: Version type: string + - jsonPath: .status.conditions[?(@.type=='Complete')].status + name: Complete + type: string + - jsonPath: .status.conditions[?(@.message!='')].message + name: Message + type: string + - jsonPath: .status.applying + name: Applying + priority: 10 + type: string name: v1 schema: openAPIV3Schema: @@ -1155,6 +1165,10 @@ spec: type: string type: array conditions: + description: |- + `LatestResolved` indicates that the latest version as per the spec has been determined. + `Validated` indicates that the plan spec has been validated. + `Complete` indicates that the latest version of the plan has completed on all selected nodes. If any Jobs for the Plan fail to complete, this condition will remain false, and the reason and message will reflect the source of the error. items: properties: lastTransitionTime: