Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface: add more stagedUpdateRun additionalPrintColumns #1008

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jwtty
Copy link
Contributor

@jwtty jwtty commented Jan 6, 2025

Description of your changes

Add additionalPrinterColumns for clusterStagedUpdateRun and clusterApprovalRequest objects.
Update the examples to use the v1beta1 APIs.

The get command outputs now look like:

kubectl get clusterstagedupdaterun
NAME          PLACEMENT           RESOURCESNAPSHOT               POLICYSNAPSHOT        INITIALIZED   SUCCEEDED   AGE
example-run   example-placement   example-placement-0-snapshot   example-placement-7   True          True        13m

kubectl get clsuterstagedupdaterun -owide
NAME          PLACEMENT           RESOURCESNAPSHOT               STRATEGY           POLICYSNAPSHOT        INITIALIZED   SUCCEEDED   AGE
example-run   example-placement   example-placement-0-snapshot   example-strategy   example-placement-7   True          True        3m47s

kubectl get clusterapprovalrequests
NAME                     UPDATERUN     STAGE        APPROVED   AGE
example-run-canary       example-run   canary       True       12m
example-run-production   example-run   production   True       11m

Fixes #

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@jwtty jwtty force-pushed the stagerun-apiexample branch from 80b0d09 to e0058dc Compare January 9, 2025 02:13
@jwtty jwtty force-pushed the stagerun-apiexample branch from e0058dc to e4822b7 Compare January 9, 2025 02:57
@jwtty jwtty changed the title chore: improve clusterStageUpdateRun UI and examples interface: add more stagedUpdateRun additionalPrintColumns Jan 9, 2025
@@ -17,6 +17,13 @@ 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=`.spec.placementName`,name="Placement",type=string
// +kubebuilder:printcolumn:JSONPath=`.spec.resourceSnapshotIndex`,name="ResourceSnapshot",type=string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have a question about this field.

we want an index or a name? from the example you provided, it's a name.

The resources could be divided to multiple snapshots.

// +kubebuilder:printcolumn:JSONPath=`.spec.placementName`,name="Placement",type=string
// +kubebuilder:printcolumn:JSONPath=`.spec.resourceSnapshotIndex`,name="ResourceSnapshot",type=string
// +kubebuilder:printcolumn:JSONPath=`.spec.stagedRolloutStrategyName`,name="Strategy",priority=1,type=string
// +kubebuilder:printcolumn:JSONPath=`.status.policySnapshotIndexUsed`,name="PolicySnapshot",type=string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, name or index?

i remember policySnapshot won't be divided to multiple ones.

@@ -397,6 +404,10 @@ 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=`.spec.parentStageRollout`,name="UpdateRun",type=string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the "-" to split the words?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants