-
Notifications
You must be signed in to change notification settings - Fork 78
Checks for k8s 1.25 deprecated APIs #151
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
Checks for k8s 1.25 deprecated APIs #151
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: bentito The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" | ||
) | ||
|
||
func GetRemovedAPIsOn1_25From(bundle *manifests.Bundle) map[string][]string { |
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 not add this implementation with https://github.com/operator-framework/api/blob/master/pkg/validation/internal/removed_apis.go?
func addDepUsage(deprecatedAPIs map[string][]string, u *unstructured.Unstructured) map[string][]string { | ||
deprecatedAPIs[u.GetKind()] = append(deprecatedAPIs[u.GetKind()], u.GetName()) | ||
return deprecatedAPIs | ||
} |
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.
Are you getting the name of the resource where the api was found? See that it is used in more places so, why not address the cleanup across the project?
|
||
func GetRemovedAPIsOn1_25From(bundle *manifests.Bundle) map[string][]string { | ||
deprecatedAPIs := make(map[string][]string) | ||
for _, obj := range bundle.Objects { |
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.
This check has not been called in any validator so it will not be useful.
See that we would need to ensure that it will be called via the operatorhub (https://github.com/operator-framework/api/blob/master/pkg/validation/internal/operatorhub.go#L106) and the alpha-deprecated-apis one (https://github.com/operator-framework/api/blob/master/pkg/validation/internal/removed_apis.go#L127)
we also need to address improvements for these scenario checks such as make clear what are the k8s versions supported by the checks and some cleanups.
Adds an externally accessible function to check for APIs to be removed in Kubernetes 1.25.
The list of removed APIs is here:
https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-25