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

Enable beta features by default #6732

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

lbernick
Copy link
Member

@lbernick lbernick commented May 26, 2023

When users decide to upgrade to v1 APIs, they may not be aware they are using beta features. If they are using the default value ("stable") of "enable-api-fields", any beta features they're using will work in beta APIs, but break when when move to v1 APIs.

This commit changes the default value of "enable-api-fields" to "beta", to ensure beta features continue to work by default when users change API versions. Independently, we plan to decouple API versioning from feature versioning (#6592).

This commit will also help avoid breakages when swapping our storage version to v1 due to the issue described here.

This commit is not backwards compatible.

Related: #6616

/kind misc

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

action required: "enable-api-fields" is set to "beta" by default. If you are using v1 APIs and would like to use only stable features, modify the "feature-flags" configmap in the "tekton-pipelines" namespace to set "enable-api-fields" to "stable". Example command: kubectl patch cm feature-flags -n tekton-pipelines -p '{"data":{"enable-api-fields":"stable"}}'
If you are using v1beta1 APIs, no action is needed.

@tekton-robot tekton-robot added kind/misc Categorizes issue or PR as a miscellaneuous one. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. labels May 26, 2023
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 26, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@JeromeJu
Copy link
Member

/assign

@lbernick
Copy link
Member Author

/hold
need to fix integration tests

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 26, 2023
@lbernick lbernick force-pushed the beta-by-default branch 2 times, most recently from acd2a68 to d857574 Compare May 30, 2023 14:49
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@lbernick
Copy link
Member Author

error was:

2023/05/30 15:16:28 process.go:153: Running: gcloud beta container clusters create --quiet --enable-autoscaling --min-nodes=1 --max-nodes=3 --scopes=cloud-platform --no-issue-client-certificate --project=tekton-prow-2 --region=us-central1 --machine-type=n1-standard-4 --image-type=cos --num-nodes=1 --network=tpipeline-e2e-net1663564572834926592 --cluster-version=1.25.8-gke.500 tpipeline-e2e-cls1663564572834926592
Default change: VPC-native is the default mode during cluster creation for versions greater than 1.21.0-gke.1500. To create advanced routes based clusters, please pass the `--no-enable-ip-alias` flag
Default change: During creation of nodepools or autoscaling configuration changes for cluster versions greater than 1.24.1-gke.800 a default location policy is applied. For Spot and PVM it defaults to ANY, and for all other VM kinds a BALANCED policy is used. To change the default values use the `--location-policy` flag.
Note: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s).
ERROR: (gcloud.beta.container.clusters.create) ResponseError: code=400, message=Creation of node pools using node images based on Docker container runtimes is not supported in GKE v1.24+ clusters as Dockershim has been removed in Kubernetes v1.24.
2023/05/30 15:16:31 process.go:155: Step 'gcloud beta container clusters create --quiet --enable-autoscaling --min-nodes=1 --max-nodes=3 --scopes=cloud-platform --no-issue-client-certificate --project=tekton-prow-2 --region=us-central1 --machine-type=n1-standard-4 --image-type=cos --num-nodes=1 --network=tpipeline-e2e-net1663564572834926592 --cluster-version=1.25.8-gke.500 tpipeline-e2e-cls1663564572834926592' finished in 3.575932749s
2023/05/30 15:16:31 main.go:319: Something went wrong: starting e2e cluster: error creating cluster: error during gcloud beta container clusters create --quiet --enable-autoscaling --min-nodes=1 --max-nodes=3 --scopes=cloud-platform --no-issue-client-certificate --project=tekton-prow-2 --region=us-central1 --machine-type=n1-standard-4 --image-type=cos --num-nodes=1 --network=tpipeline-e2e-net1663564572834926592 --cluster-version=1.25.8-gke.500 tpipeline-e2e-cls1663564572834926592: exit status 1

test pass locally-- if retesting passes I will file an issue
/retest

@lbernick
Copy link
Member Author

error was:

2023/05/30 15:16:28 process.go:153: Running: gcloud beta container clusters create --quiet --enable-autoscaling --min-nodes=1 --max-nodes=3 --scopes=cloud-platform --no-issue-client-certificate --project=tekton-prow-2 --region=us-central1 --machine-type=n1-standard-4 --image-type=cos --num-nodes=1 --network=tpipeline-e2e-net1663564572834926592 --cluster-version=1.25.8-gke.500 tpipeline-e2e-cls1663564572834926592
Default change: VPC-native is the default mode during cluster creation for versions greater than 1.21.0-gke.1500. To create advanced routes based clusters, please pass the `--no-enable-ip-alias` flag
Default change: During creation of nodepools or autoscaling configuration changes for cluster versions greater than 1.24.1-gke.800 a default location policy is applied. For Spot and PVM it defaults to ANY, and for all other VM kinds a BALANCED policy is used. To change the default values use the `--location-policy` flag.
Note: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s).
ERROR: (gcloud.beta.container.clusters.create) ResponseError: code=400, message=Creation of node pools using node images based on Docker container runtimes is not supported in GKE v1.24+ clusters as Dockershim has been removed in Kubernetes v1.24.
2023/05/30 15:16:31 process.go:155: Step 'gcloud beta container clusters create --quiet --enable-autoscaling --min-nodes=1 --max-nodes=3 --scopes=cloud-platform --no-issue-client-certificate --project=tekton-prow-2 --region=us-central1 --machine-type=n1-standard-4 --image-type=cos --num-nodes=1 --network=tpipeline-e2e-net1663564572834926592 --cluster-version=1.25.8-gke.500 tpipeline-e2e-cls1663564572834926592' finished in 3.575932749s
2023/05/30 15:16:31 main.go:319: Something went wrong: starting e2e cluster: error creating cluster: error during gcloud beta container clusters create --quiet --enable-autoscaling --min-nodes=1 --max-nodes=3 --scopes=cloud-platform --no-issue-client-certificate --project=tekton-prow-2 --region=us-central1 --machine-type=n1-standard-4 --image-type=cos --num-nodes=1 --network=tpipeline-e2e-net1663564572834926592 --cluster-version=1.25.8-gke.500 tpipeline-e2e-cls1663564572834926592: exit status 1

test pass locally-- if retesting passes I will file an issue /retest

This happened because our prow config hard-codes the file "test/e2e-tests-kind-prow.env" which I attempted to rename. reverted.

@lbernick lbernick removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 30, 2023
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

Copy link
Member

@JeromeJu JeromeJu left a comment

Choose a reason for hiding this comment

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

Thanks Lee!
shall we also change to beta at prow.env for testing the defaults deployed?

Copy link
Member

@JeromeJu JeromeJu left a comment

Choose a reason for hiding this comment

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

Thanks Lee!
shall we also change to beta at prow.env for testing the defaults deployed?

@lbernick
Copy link
Member Author

lbernick commented Jun 5, 2023

Thanks Lee! shall we also change to beta at prow.env for testing the defaults deployed?

I think we already have 3 e2e configurations for prow, one for each feature gate, so I'm not sure we need changes. The file e2e-tests-kind.env doesn't seem to be used anywhere in our prow config.

When users decide to upgrade to v1 APIs, they may not be aware they
are using beta features. If they are using the default value ("stable") of "enable-api-fields",
any beta features they're using will work in beta APIs, but break when when move to v1 APIs.

This commit changes the default value of "enable-api-fields" to "beta", to ensure beta
features continue to work by default when users change API versions.
Independently, we plan to decouple API versioning from feature versioning.

This commit is not backwards compatible.
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/workspace_validation.go 100.0% 97.6% -2.4

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JeromeJu, vdemeester

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 8, 2023
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thanks for this.
Would it make sense to deprecate the beta default value right away (it can be in a different PR) and setting a date by when we will switch back to stable as default?

As discussed, I'd love to see the feature flag decoupled from the API version in future.
/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 8, 2023
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thanks for this.
Would it make sense to deprecate the beta default value right away (it can be in a different PR) and setting a date by when we will switch back to stable as default?

As discussed, I'd love to see the feature flag decoupled from the API version in future.
/lgtm

@tekton-robot tekton-robot merged commit 6b243df into tektoncd:main Jun 8, 2023
@lbernick
Copy link
Member Author

lbernick commented Jun 8, 2023

Thanks for this. Would it make sense to deprecate the beta default value right away (it can be in a different PR) and setting a date by when we will switch back to stable as default?

I think this is worth a separate discussion. We'd need to find some way to resolve the issue referenced when using "stable" as the default. I also think "beta" is a reasonable default anyway: k8s enables beta features by default. My preferred solution is per-feature flags.

As discussed, I'd love to see the feature flag decoupled from the API version in future.

👍 , this is causing a lot of problems tbh

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. kind/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants