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

Consider returning warnings in validation for usage of deprecated fields #10725

Open
17 tasks
chrischdi opened this issue Jun 5, 2024 · 6 comments
Open
17 tasks
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@chrischdi
Copy link
Member

chrischdi commented Jun 5, 2024

What would you like to be added (User Story)?

As a user I would like to get a warning when I make use of deprecated fields.

Detailed Description

We already have some deprecated fields:

  • Cluster
    • spec.topology.rolloutAfter
    • spec.topology.variables[].definitionFrom
    • spec.topology.controlPlane.variables.overrides[].definitionFrom
    • spec.topology.workers.machineDeployments[].variables.overrides[].definitionFrom
    • spec.topology.workers.machinePools[].variables.overrides[].definitionFrom
  • ClusterClass
    • spec.variables[].metadata
  • MachineDeployment
    • spec.revisionHistoryLimit
  • MachineHealthCheck
    • spec.maxUnhealthy
    • spec.unhealthyRange
  • KubeadmConfig (also KubeadmConfigTemplate, KubeadmControlPlane, KubeadmControlPlaneTemplate)
    • spec.useExperimentalRetryJoin
  • DockerMachine
    • .spec.bootstrapped

and considering e.g.:

we may introduce more in future.

For providing a user the information that it makes use of a deprecated field, we could use warnings in validation to bubble that information up.

Anything else you would like to add?

No response

Label(s) to be applied

/kind feature
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 5, 2024
@sbueringer
Copy link
Member

sbueringer commented Jun 10, 2024

@fabriziopandini fabriziopandini added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Jul 3, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates an issue lacks a `priority/foo` label and requires one. label Jul 3, 2024
@fabriziopandini
Copy link
Member

/triage accepted
/help

we can evaluate case by case on follow up PRs

@k8s-ci-robot
Copy link
Contributor

@fabriziopandini:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/triage accepted
/help

we can evaluate case by case on follow up PRs

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 3, 2024
@chrischdi
Copy link
Member Author

Yup also

I think this is a great idea, and we should do this for all fields now & going forward

moved these up to the list

@sbueringer
Copy link
Member

sbueringer commented Jul 15, 2024

Updated the list in the issue description & structured by CRD

@sbueringer
Copy link
Member

sbueringer commented Jul 15, 2024

A few general comments from my side:

  • I think we should be careful with fields that are set per default. I think it's a bad idea to emit warnings for fields that we default, because then it's not actually the user/controller/client setting them and every single user/controller/client will get the warnings (they will probably (afaik) also show up in our own core CAPI controller logs)
  • I think in any case it would be good to have a flag to opt-out from this feature. I think if some folks are using Cluster API within their products it's totally fine if they are not forced to emit these warnings to their end users. So there should be away to avoid spaming everyone with warnings if folks are aware of the deprecations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants