-
Notifications
You must be signed in to change notification settings - Fork 828
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
feat(operator): add custom printcolumns for seldon-specific CRs #5736
Conversation
Additional printcolumns for CRs covered in this change: - Models: ModelReady, Replicas, Age - Pipelines: Ready, ModelsReady, PipelineReady, Message, Age - Servers: Ready, Replicas, Loaded Models, Age - Experiments: ExperimentReady, CandidatesReady, MirrorReady, Message, Age
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.
generated
k8s/yaml/crds.yaml
Outdated
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.
generated
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.
generated
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.
generated
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.
generated
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.
generated
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.
LGTM! I left a comment on whether it is possible to add any testing, guardrails in the cases of a change in the current fields that are used.
@@ -54,6 +54,11 @@ type ExperimentStatus struct { | |||
//+kubebuilder:object:root=true | |||
//+kubebuilder:subresource:status | |||
//+kubebuilder:resource:shortName=mlx | |||
//+kubebuilder:printcolumn:name="Experiment ready",type=string,JSONPath=`.status.conditions[?(@.type=='ExperimentReady')].status`,description="Experiment ready status" |
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.
how can we maintain these settings, eg. if we change some of these conditions that we are returning?
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.
They are quite difficult to directly test, mostly because this is an added comment used by kubebuilder when generating the CRDs (yaml files), rather than executable code. The failure mode here is quite lenient though, with any printcolumn referencing nonexistent data showing as empty.
Thinking outside the box a bit, we could imagine a test using the exact same fields as the kubebuilder comments, which will start failing when we change any of the status conditions. The failing test should contain a message explaining that one needs to change the comments here, and only update the test itself afterwards.
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 have accepted the challenge :-) and added tests. I might have exaggerated a bit, actually.
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.
thanks for finding a way to test it.
Those tests fail if we modify the CRDs in a way which changes the names of the fields printed in kubebuilder:printcolumn
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.
LGTM. thanks for adding the tests.
Additional printcolumns for CRs covered in this change:
Models: ModelReady, Replicas, Age
Pipelines: Ready, ModelsReady*, PipelineReady*, Message, Age
Servers: Ready, Replicas, Loaded Models, Age
Experiments: ExperimentReady, CandidatesReady*, MirrorReady*, Message, Age
The additional columns show up when getting the list of objects of a given type via
kubectl get
, and subsequently also show up in k9s.Printcolumns marked with * above only show up when running
kubectl get ... -o wide
Which issue(s) this PR fixes:
Fixes #INFRA-1058 (internal): Print additional fields for seldon-specific CRDs
Special notes for your reviewer:
PR contains automatically-generated files, will mark those with a comment