-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
🌱 Provide namespace of the referenced ClusterClass in TEMPLATENAMESPACE
#11802
base: main
Are you sure you want to change the base?
🌱 Provide namespace of the referenced ClusterClass in TEMPLATENAMESPACE
#11802
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/area api |
b07a2cf
to
ec62646
Compare
api/v1beta1/cluster_types.go
Outdated
@@ -1037,6 +1037,7 @@ func (v APIEndpoint) String() string { | |||
// +kubebuilder:storageversion | |||
// +kubebuilder:subresource:status | |||
// +kubebuilder:printcolumn:name="ClusterClass",type="string",JSONPath=".spec.topology.class",description="ClusterClass of this Cluster, empty if the Cluster is not using a ClusterClass" | |||
// +kubebuilder:printcolumn:name="TemplateNamespace",type="string",JSONPath="..['spec.topology.classNamespace','metadata.namespace']",description="Template namespace of this Cluster",priority=10 |
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.
TemplateNamespace seems a bit misleading to me.
We have many templates. Some referenced in control plane / MD / MS objects. Some referenced from the ClusterClass. Wouldn't the more appropriate name be ClusterClassNamespace?
Ideally maybe something that ends up as CLUSTERCLASS_NAMESPACE if that is possible? (not sure if there are naming conventions for columns)
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 think CLUSTERCLASS_NAMESPACE is better here. The problem is thought that it will be displayed without spec.template.class
being set, if queried with kubectl get clusters -o wide
. What I wanted to convey is CLUSTER_CLASS_TEMPLATES_NAMESPACE
, as the location from where the definitions originate and being cloned. Maybe in combination with ClusterClass
field defaulting to empty is not that misleading.
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.
Hm yeah an empty column is probably confusing in all variants. Ideally we could fallback to show the Cluster.Namespace instead of course (I assume with CEL that would be possible, with jsonPath today probably not?)
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.
This is possible with the expression provided.
- If the classNamespace is not set, it uses the namespace of the cluster:
NAME CLUSTERCLASS CLUSTERCLASS_NAMESPACE PHASE AGE VERSION
capi-quickstart quick-start default 81m v1.32.0
- If the classNamespace is set, it displays the value
NAME CLUSTERCLASS CLUSTERCLASS_NAMESPACE PHASE AGE VERSION
capi-quickstart quick-start otherns 81m v1.32.0
- The only thing it can’t do now, but a CEL will be able (though it will be a while?) is to not display a namespace if
topology.class
is empty:
NAME CLUSTERCLASS CLUSTERCLASS_NAMESPACE PHASE AGE VERSION
capi-quickstart default 81m v1.32.0
The field is present in the -o wide
now anyway, so it is not a problem?
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.
Ah got it, should have seen that.
The field is present in the -o wide now anyway, so it is not a problem?
Not sure, looks a bit awkward for folks not using ClusterClass
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 don't know exact timeline, but if CEL is an option in the near future, what if we defer this change?
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.
No strong opinions.
If we wait for CEL we have to wait for this KEP to reach GA + ~ 1,5 years. So we're probably talking by delaying at least by 2 or 2,5 years
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.
But on the other side. I don't see a way to implement this today which is not confusing in some cases
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.
Yep, it feels that we are forcing a solution that doesn't make anyone happy.
Also, we are going to review all the columns is a short term for v1beta2, and we already know that we have space constraints
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 would probably go with not adding the column for now.
(Note: I think it's fine if CAPI distributions are adding additional columns like this downstream if they want. They might not have all the use cases so the column might not be confusing there)
9f02d74
to
67efc6e
Compare
Signed-off-by: Danil-Grigorev <[email protected]>
67efc6e
to
23768bd
Compare
What this PR does / why we need it:
Allow to display ClusterClass and templates namespace in the table output of Cluster objects:
A cluster without
classNamespace
:Using
classNamespace
as the source for the value, unless is not specified, in which case themetadata.namespace
is displayed.This will improve UX and reduce confusion, when looking up referenced templates or the
ClusterClass
in the namespace of theCluster
, when those are located elsewhere.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Related to #5673