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

stop serving deleted APIs #90983

Closed
wants to merge 1 commit into from
Closed

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented May 11, 2020

This programatically enforces the removal of beta APIs that have expired. Alpha levels have a grace period so that we can chase down their removal smoothly with CI by disabling the affected tests. Controllers already had to handle the beta level detection, so they shouldn't be an issue.

/kind bug
/priority important-soon
@kubernetes/sig-api-machinery-bugs

/hold the factorization is whacky, but I want to record the spot

The kube-apiserver will no longer serve APIs that should have been deleted in GA non-alpha levels.  Alpha levels will continue to serve the removed APIs so that CI doesn't immediately break.

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 11, 2020
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 11, 2020
@fedebongio
Copy link
Contributor

/assign @liggitt
/cc @lavalamp

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 6, 2020
@liggitt liggitt added this to the v1.20 milestone Jul 8, 2020
@justaugustus justaugustus modified the milestones: v1.20, v1.20-phase-bug Aug 27, 2020
@justaugustus justaugustus modified the milestones: v1.20-phase-bug, v1.20 Sep 8, 2020
@deads2k deads2k force-pushed the beta-stop-serving branch 2 times, most recently from d05ae11 to 9d1e80c Compare November 4, 2020 21:20
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2020
@sttts
Copy link
Contributor

sttts commented Nov 5, 2020

Since when do we fail on unused private methods?

pkg/controlplane/deleted_kinds_test.go:96:6: func storageNeverRemoved is unused (U1000)

// This is usually set by a cluster-admin looking for a short-term escape hatch after something bad happened.
// This should be made a flag before merge
// Set KUBE_APISERVER_SERVE_REMOVED_APIS_FOR_ONE_RELEASE to prevent removing APIs for one more release.
serveRemoveAPIsOneMoreRelease bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed

}
}

for resourceName := range versionedResourcesStorageMap[apiVersion] {
Copy link
Contributor

Choose a reason for hiding this comment

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

why this double loop, and versionedResourcesStorageMap[apiVersion] vs. versionToResource?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why this double loop, and versionedResourcesStorageMap[apiVersion] vs. versionToResource?

10 lines up, the godoc describes the args. This mirrors the structure in APIGroupInfo, so per the comment it's a map from version to resource to the storage.. If I change it here, the usage becomes more difficult and the results cannot be directly used.

}
}

func shouldRemoveResource(resourcesToRemove sets.String, resourceName string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldRemoveResourceAndSubresources

return true
}
// our API works on nesting, so you can have deployments, deployments/status, and deployments/scale. Not all subresources
// server the parent type, but if the parent type (deployments in this case), has been removed, it's subresources should be removed too.
Copy link
Contributor

Choose a reason for hiding this comment

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

serve the parent type

@@ -25,6 +25,8 @@ import (
"strconv"
"time"

"k8s.io/component-base/version"
Copy link
Contributor

Choose a reason for hiding this comment

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

order

@sttts
Copy link
Contributor

sttts commented Nov 11, 2020

/lgtm
/approve
/hold

Just some nits. Feel free to unhold and retag after fixing.

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 11, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 11, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, sttts

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 removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 11, 2020
@deads2k
Copy link
Contributor Author

deads2k commented Nov 11, 2020

$ git fetch https://github.com/kubernetes/kubernetes.git pull/90983/head
From https://github.com/kubernetes/kubernetes
 * branch                    refs/pull/90983/head -> FETCH_HEAD
$ git merge --no-ff a6a6b17348909030b7563dd1c21fa166c668844b
merge: a6a6b17348909030b7563dd1c21fa166c668844b - not something we can merge
# Error: exit status 1

slow github repo update?

/retest

@deads2k
Copy link
Contributor Author

deads2k commented Nov 11, 2020

/retest

1 similar comment
@deads2k
Copy link
Contributor Author

deads2k commented Nov 12, 2020

/retest

@deads2k
Copy link
Contributor Author

deads2k commented Nov 12, 2020

/retest

@sttts
Copy link
Contributor

sttts commented Nov 13, 2020

/retest
/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 13, 2020
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Nov 13, 2020

@deads2k: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-100-performance 48ac4d4 link /test pull-kubernetes-e2e-gce-100-performance
pull-kubernetes-node-e2e 48ac4d4 link /test pull-kubernetes-node-e2e
pull-kubernetes-e2e-gce-ubuntu-containerd 48ac4d4 link /test pull-kubernetes-e2e-gce-ubuntu-containerd

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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/test-infra repository. I understand the commands that are listed here.

@liggitt
Copy link
Member

liggitt commented Nov 18, 2020

replaced by #96525

/close

@k8s-ci-robot
Copy link
Contributor

@liggitt: Closed this PR.

In response to this:

replaced by #96525

/close

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/test-infra repository.

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants