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
stop serving deleted APIs #90983
Conversation
ff89261
to
8f65c80
Compare
8f65c80
to
99fa877
Compare
99fa877
to
909412c
Compare
d05ae11
to
9d1e80c
Compare
Since when do we fail on unused private methods? pkg/controlplane/deleted_kinds_test.go:96:6: func storageNeverRemoved is unused (U1000) |
9d1e80c
to
6b72016
Compare
pkg/controlplane/deleted_kinds.go
Outdated
// 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 |
There was a problem hiding this comment.
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] { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
pkg/controlplane/deleted_kinds.go
Outdated
} | ||
} | ||
|
||
func shouldRemoveResource(resourcesToRemove sets.String, resourceName string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldRemoveResourceAndSubresources
pkg/controlplane/deleted_kinds.go
Outdated
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serve the parent type
pkg/controlplane/instance.go
Outdated
@@ -25,6 +25,8 @@ import ( | |||
"strconv" | |||
"time" | |||
|
|||
"k8s.io/component-base/version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
order
/lgtm Just some nits. Feel free to unhold and retag after fixing. |
[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 |
6b72016
to
a6a6b17
Compare
slow github repo update? /retest |
/retest |
1 similar comment
/retest |
a6a6b17
to
48ac4d4
Compare
/retest |
/retest |
@deads2k: The following tests failed, say
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. |
replaced by #96525 /close |
@liggitt: Closed this PR. In response to this:
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. |
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