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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 Small improvements to ClusterClass validation messages #5744

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
This PR contains a set of small improvements to ClusterClass validation messages.
While working on this, I also made consistent how we are calling validation func in unit tests.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 29, 2021
internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/webhooks/cluster.go Outdated Show resolved Hide resolved
Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Thx for improving this, even when it's not fun dealing with the nitpickery on the PR! :)

I think good errors are important for the UX and this PR is a great step forward!

internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/topology/check/compatibility_test.go Outdated Show resolved Hide resolved
@@ -178,9 +175,10 @@ func (webhook *ClusterClass) validateRemovedMachineDeploymentClassesAreNotUsed(c
for _, machineDeploymentTopology := range c.Spec.Topology.Workers.MachineDeployments {
if removedClasses.Has(machineDeploymentTopology.Class) {
// TODO(killianmuldoon): Improve error printing here so large scale changes don't flood the error log e.g. deduplication, only example usages given.
// TODO: consider if we get the index of the MachineDeploymentClass being deleted
Copy link
Member

Choose a reason for hiding this comment

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

I think that depends on if the path should apply to the old or new resource (or depending on the case one or the other)

@fabriziopandini
Copy link
Member Author

@killianmuldoon @sbueringer thanks for all the valuable comments. Now the PR should be ready for another round 馃槈

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Looks great, last round of nits from my side :)

internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
internal/topology/check/compatibility.go Outdated Show resolved Hide resolved
@fabriziopandini fabriziopandini force-pushed the small-improvements-to-clusterclass-validation-messages branch from dc7524d to 22d503e Compare November 30, 2021 18:11
@sbueringer
Copy link
Member

Thx!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 30, 2021
@vincepri
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 30, 2021
@k8s-ci-robot k8s-ci-robot merged commit 664a887 into kubernetes-sigs:main Nov 30, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.1 milestone Nov 30, 2021
@fabriziopandini fabriziopandini deleted the small-improvements-to-clusterclass-validation-messages branch December 6, 2021 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants