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. DetailsNeeds 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.
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.
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.
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