-
Notifications
You must be signed in to change notification settings - Fork 26
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: improve ClusterStagedUpdateRun APIs #1008
base: main
Are you sure you want to change the base?
Conversation
e0058dc
to
e4822b7
Compare
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the name. And we have a validation that only the master snapshot name should be provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we need to rename the spec field as discussed
b5d3d56
to
5e0e36d
Compare
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Succeeded")].status`,name="Succeeded",type=string | ||
// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date | ||
// +kubebuilder:printcolumn:JSONPath=`.spec.stagedRolloutStrategyName`,name="Strategy",priority=1,type=string | ||
// +kubebuilder:validation:XValidation:rule="size(self.metadata.name) < 128",message="metadata.name max length is 127" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need a test for this, similiar to test/apis/placement/v1beta1/api_validation_integration_test.go
@@ -102,7 +110,7 @@ type ClusterStagedUpdateStrategyList struct { | |||
type StageConfig struct { | |||
// The name of the stage. This MUST be unique within the same StagedUpdateStrategy. | |||
// +kubebuilder:validation:MaxLength=63 | |||
// +kubebuilder:validation:Pattern="[A-Za-z0-9]+$" | |||
// +kubebuilder:validation:Pattern="^[a-z0-9]+$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why we only allow lower case for stage name?
Description of your changes
clusterStagedUpdateRun
andclusterApprovalRequest
objects.The
get
command outputs now look like:Fixes #
I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer