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

Deprecated definitionFrom in cluster variables #10666

Open
fabriziopandini opened this issue May 23, 2024 · 3 comments
Open

Deprecated definitionFrom in cluster variables #10666

fabriziopandini opened this issue May 23, 2024 · 3 comments
Assignees
Labels
area/clusterclass Issues or PRs related to clusterclass help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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

@fabriziopandini
Copy link
Member

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

As a user I want a clean and simple API surface
As a CC or Runtime Extensions author I want clear guidelines about variable definition

Detailed Description

Back when we introduced variable discovery for runtime extensions, we discussed a lot about how to handle conflicts in case two entities (either cluster class inline variables or runtime extensions) define a variable with the same name but a different type definition - aka conflicts -.

The solution we came up for was based on the idea of handling this with a "degraded UX", forcing the user to specify the definitionFrom value when setting the variable value.

After some time and experience with this feature, it seems this is unnecessary complexity; we should simply the user experience, drop definitionFrom and leave to the cluster class and Runtime Extensions authors the responsibility to avoid conflict, for two reasons:

  • it rarely happens to have two or more entities providing variables
  • if there are two or more entities using the same variable name,
    • in most cases they simply want to reuse the same variable for another patch.
    • in case they don't agree on the semantic meaning of the variable, which is implied in the type definition, this is really confusing to the users. So it is better to force the resolution of this issue in the authoring phase vs putting this complexity on the users

Anything else you would like to add?

We still think that is valuable to enforce that each entity (either cluster class inline variables or runtime extensions) must define all the variables it is using, because in case one of those will drift, everyone else using the same variable won't have unexpected side effects.

However, also in this case, we should force to the entity owners (cc or runtime extension authors) the resolution of the issue.

Please also note that strategies like naming conventions (eg. use a different prefix for each entity owner) can be stiil be used to avoid conflicts, but finding a shared semantic shuold alway be the preferred way to go for, because it ultimately improve the user experience on all the clusters derived from a cluster class.

Label(s) to be applied

/kind feature
/area clusterclass
/priority important-longterm
/triage accepted
/help

@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:

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

As a user I want a clean and simple API surface
As a CC or Runtime Extensions author I want clear guidelines about variable definition

Detailed Description

Back when we introduced variable discovery for runtime extensions, we discussed a lot about how to handle conflicts in case two entities (either cluster class inline variables or runtime extensions) define a variable with the same name but a different type definition - aka conflicts -.

The solution we came up for was based on the idea of handling this with a "degraded UX", forcing the user to specify the definitionFrom value when setting the variable value.

After some time and experience with this feature, it seems this is unnecessary complexity; we should simply the user experience, drop definitionFrom and leave to the cluster class and Runtime Extensions authors the responsibility to avoid conflict, for two reasons:

  • it rarely happens to have two or more entities providing variables
  • if there are two or more entities using the same variable name,
    • in most cases they simply want to reuse the same variable for another patch.
    • in case they don't agree on the semantic meaning of the variable, which is implied in the type definition, this is really confusing to the users. So it is better to force the resolution of this issue in the authoring phase vs putting this complexity on the users

Anything else you would like to add?

We still think that is valuable to enforce that each entity (either cluster class inline variables or runtime extensions) must define all the variables it is using, because in case one of those will drift, everyone else using the same variable won't have unexpected side effects.

However, also in this case, we should force to the entity owners (cc or runtime extension authors) the resolution of the issue.

Please also note that strategies like naming conventions (eg. use a different prefix for each entity owner) can be stiil be used to avoid conflicts, but finding a shared semantic shuold alway be the preferred way to go for, because it ultimately improve the user experience on all the clusters derived from a cluster class.

Label(s) to be applied

/kind feature
/area clusterclass
/priority important-longterm
/triage accepted
/help

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 kind/feature Categorizes issue or PR as related to a new feature. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. area/clusterclass Issues or PRs related to clusterclass 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. labels May 23, 2024
@sbueringer
Copy link
Member

100%

Just wanted to add that definitionFrom adds a lot of complexity today. For us as maintainers, but especially to our users (cf complexity budget). I think it's not worth that complexity.

This becomes more obvious when thinking about how definitionFrom should behave in "transition scenarios" (when conflicts occur or are resolved). I think today this prevents us to add bigger orthogonal features to variables because it's very hard to make sure all variants still work (eg potentially introducing variable scopes down the line)

@sbueringer sbueringer added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label May 28, 2024
@sbueringer
Copy link
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterclass Issues or PRs related to clusterclass help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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

3 participants