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

Checks for k8s 1.25 deprecated APIs #151

Closed

Conversation

bentito
Copy link
Contributor

@bentito bentito commented Aug 30, 2021

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

@openshift-ci
Copy link

openshift-ci bot commented Aug 30, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bentito
To complete the pull request process, please assign dinhxuanvu after the PR has been reviewed.
You can assign the PR to them by writing /assign @dinhxuanvu in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

func GetRemovedAPIsOn1_25From(bundle *manifests.Bundle) map[string][]string {
Copy link
Contributor

Choose a reason for hiding this comment

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

func addDepUsage(deprecatedAPIs map[string][]string, u *unstructured.Unstructured) map[string][]string {
deprecatedAPIs[u.GetKind()] = append(deprecatedAPIs[u.GetKind()], u.GetName())
return deprecatedAPIs
}
Copy link
Contributor

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 {
Copy link
Contributor

@camilamacedo86 camilamacedo86 Oct 1, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants