Skip to content

Commit

Permalink
improve clusterStageUpdateRun UI and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jwtty committed Jan 9, 2025
1 parent 3479ddb commit e0058dc
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
5 changes: 5 additions & 0 deletions apis/placement/v1alpha1/stagedupdate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import (
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster,categories={fleet,fleet-placement},shortName=crsur
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Initialized")].status`,name="Initialized",type=string
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Succeeded")].status`,name="Succeeded",type=string
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date

// ClusterStagedUpdateRun represents a stage by stage update process that applies ClusterResourcePlacement
// selected resources to specified clusters.
Expand Down Expand Up @@ -397,6 +400,8 @@ type ClusterStagedUpdateRunList struct {
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster,categories={fleet,fleet-placement},shortName=careq
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Approved")].status`,name="Approved",type=string
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date

// ClusterApprovalRequest defines a request for user approval for cluster staged update run.
// The request object MUST have the following labels:
Expand Down
5 changes: 5 additions & 0 deletions apis/placement/v1beta1/stageupdate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import (
// +kubebuilder:resource:scope=Cluster,categories={fleet,fleet-placement},shortName=crsur
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Initialized")].status`,name="Initialized",type=string
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Succeeded")].status`,name="Succeeded",type=string
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date

// ClusterStagedUpdateRun represents a stage by stage update process that applies ClusterResourcePlacement
// selected resources to specified clusters.
Expand Down Expand Up @@ -398,6 +401,8 @@ type ClusterStagedUpdateRunList struct {
// +kubebuilder:resource:scope=Cluster,categories={fleet,fleet-placement},shortName=careq
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Approved")].status`,name="Approved",type=string
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date

// ClusterApprovalRequest defines a request for user approval for cluster staged update run.
// The request object MUST have the following labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ spec:
singular: clusterapprovalrequest
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Approved")].status
name: Approved
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
Expand Down Expand Up @@ -150,7 +157,14 @@ spec:
storage: false
subresources:
status: {}
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Approved")].status
name: Approved
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ spec:
singular: clusterstagedupdaterun
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Initialized")].status
name: Initialized
type: string
- jsonPath: .status.conditions[?(@.type=="Succeeded")].status
name: Succeeded
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
Expand Down Expand Up @@ -1213,7 +1223,17 @@ spec:
storage: false
subresources:
status: {}
- name: v1beta1
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=="Initialized")].status
name: Initialized
type: string
- jsonPath: .status.conditions[?(@.type=="Succeeded")].status
name: Succeeded
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: |-
Expand Down
4 changes: 2 additions & 2 deletions examples/stagedupdaterun/approvalRequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ spec:
targetStage: canary
status:
conditions:
- type: Approved
status: "True"
- type: Approved
status: "True"

0 comments on commit e0058dc

Please sign in to comment.