Skip to content

Commit 04f3372

Browse files
committed
Improve docs and table output for conditions
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
1 parent fa16395 commit 04f3372

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

doc/plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ _Appears in:_
138138

139139
| Field | Description | Default | Validation |
140140
| --- | --- | --- | --- |
141-
| `conditions` _GenericCondition array_ | | | |
141+
| `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. | | |
142142
| `latestVersion` _string_ | The latest version, as resolved from .spec.version, or the channel server. | | |
143143
| `latestHash` _string_ | The hash of the most recently applied plan .spec. | | |
144144
| `applying` _string array_ | List of Node names that the Plan is currently being applied on. | | |

pkg/apis/upgrade.cattle.io/v1/types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ var (
2727
// +kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.spec.upgrade.image`
2828
// +kubebuilder:printcolumn:name="Channel",type=string,JSONPath=`.spec.channel`
2929
// +kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.version`
30+
// +kubebuilder:printcolumn:name="Complete",type=string,JSONPath=`.status.conditions[?(@.type=='Complete')].status`
31+
// +kubebuilder:printcolumn:name="Message",type=string,JSONPath=`.status.conditions[?(@.message!='')].message`
32+
// +kubebuilder:printcolumn:name="Applying",type=string,JSONPath=`.status.applying`,priority=10
3033
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3134

3235
// Plan represents a set of Jobs to apply an upgrade (or other operation) to set of Nodes.
@@ -83,6 +86,9 @@ type PlanSpec struct {
8386

8487
// PlanStatus represents the resulting state from processing Plan events.
8588
type PlanStatus struct {
89+
// `LatestResolved` indicates that the latest version as per the spec has been determined.
90+
// `Validated` indicates that the plan spec has been validated.
91+
// `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.
8692
// +optional
8793
// +patchMergeKey=type
8894
// +patchStrategy=merge

pkg/crds/yaml/generated/upgrade.cattle.io_plans.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ spec:
2424
- jsonPath: .spec.version
2525
name: Version
2626
type: string
27+
- jsonPath: .status.conditions[?(@.type=='Complete')].status
28+
name: Complete
29+
type: string
30+
- jsonPath: .status.conditions[?(@.message!='')].message
31+
name: Message
32+
type: string
33+
- jsonPath: .status.applying
34+
name: Applying
35+
priority: 10
36+
type: string
2737
name: v1
2838
schema:
2939
openAPIV3Schema:
@@ -1155,6 +1165,10 @@ spec:
11551165
type: string
11561166
type: array
11571167
conditions:
1168+
description: |-
1169+
`LatestResolved` indicates that the latest version as per the spec has been determined.
1170+
`Validated` indicates that the plan spec has been validated.
1171+
`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.
11581172
items:
11591173
properties:
11601174
lastTransitionTime:

0 commit comments

Comments
 (0)