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

Show k8s API Deprecation Warnings #257

Closed
danielhelfand opened this issue Jul 26, 2021 · 4 comments · Fixed by #266
Closed

Show k8s API Deprecation Warnings #257

danielhelfand opened this issue Jul 26, 2021 · 4 comments · Fixed by #266
Assignees
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request

Comments

@danielhelfand
Copy link
Contributor

Describe the problem/challenge you have

With the addition of #245, kapp by default will not show API deprecation notices as shown in this commit: 4f554b0

Users may want to see these deprecation notices as part of using kapp, so it might be helpful to provide an option to show deprecation notices in output. This will help users catch deprecation notices in advance sooner as described here.

Describe the solution you'd like

My initial thought is to provide a command line option (e.g. --show-deprecation-warnings) with kapp deploy/delete commands that will show warnings like below:

W0719 09:22:53.305568   47369 warnings.go:67] storage.k8s.io/v1beta1 VolumeAttachment is deprecated in v1.19+, unavailable in v1.22+; use storage.k8s.io/v1 VolumeAttachment
W0719 09:22:53.305624   47369 warnings.go:67] storage.k8s.io/v1beta1 CSIDriver is deprecated in v1.19+, unavailable in v1.22+; use storage.k8s.io/v1 CSIDriver
W0719 09:22:53.305568   47369 warnings.go:67] networking.k8s.io/v1beta1 IngressClass is deprecated in v1.19+, unavailable in v1.22+; use networking.k8s.io/v1 IngressClassList
W0719 09:22:53.305569   47369 warnings.go:67] scheduling.k8s.io/v1beta1 PriorityClass is deprecated in v1.14+, unavailable in v1.22+; use scheduling.k8s.io/v1 PriorityClass
W0719 09:22:53.306062   47369 warnings.go:67] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
W0719 09:22:53.306093   47369 warnings.go:67] coordination.k8s.io/v1beta1 Lease is deprecated in v1.19+, unavailable in v1.22+; use coordination.k8s.io/v1 Lease
W0719 09:22:53.309686   47369 warnings.go:67] storage.k8s.io/v1beta1 StorageClass is deprecated in v1.19+, unavailable in v1.22+; use storage.k8s.io/v1 StorageClass
W0719 09:22:53.312761   47369 warnings.go:67] networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
W0719 09:22:53.317088   47369 warnings.go:67] rbac.authorization.k8s.io/v1beta1 Role is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 Role
W0719 09:22:53.318580   47369 warnings.go:67] storage.k8s.io/v1beta1 CSINode is deprecated in v1.17+, unavailable in v1.22+; use storage.k8s.io/v1 CSINode
W0719 09:22:53.318716   47369 warnings.go:67] apiregistration.k8s.io/v1beta1 APIService is deprecated in v1.19+, unavailable in v1.22+; use apiregistration.k8s.io/v1 APIService
W0719 09:22:53.319085   47369 warnings.go:67] rbac.authorization.k8s.io/v1beta1 RoleBinding is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 RoleBinding
W0719 09:22:53.333891   47369 warnings.go:67] admissionregistration.k8s.io/v1beta1 MutatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration
W0719 09:22:53.334257   47369 warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
W0719 09:22:53.401374   47369 warnings.go:67] admissionregistration.k8s.io/v1beta1 ValidatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration
W0719 09:22:53.403840   47369 warnings.go:67] rbac.authorization.k8s.io/v1beta1 ClusterRole is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRole
W0719 09:22:53.404188   47369 warnings.go:67] certificates.k8s.io/v1beta1 CertificateSigningRequest is deprecated in v1.19+, unavailable in v1.22+; use certificates.k8s.io/v1 CertificateSigningRequest
W0719 09:22:53.406843   47369 warnings.go:67] rbac.authorization.k8s.io/v1beta1 ClusterRoleBinding is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRoleBinding

So the final command might look like:

kapp deploy -a app -f app.yml --show-deprecation-warnings

It might also be nice to format the deprecation notices in a way that fits kapp's current UX.

Anything else you would like to add:

Information on client handling: https://kubernetes.io/blog/2020/09/03/warnings/#customize-client-handling


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@danielhelfand danielhelfand added enhancement This issue is a feature request carvel triage This issue has not yet been reviewed for validity labels Jul 26, 2021
@cppforlife
Copy link
Contributor

cppforlife commented Jul 27, 2021

i would change the flag to --deprecation-warnings=bool with a possibly default of true since i think kubectl shows warnings by default as well. should we default to false? (if we do, who would turn them on?)

also we should only show same warning once to the user.

@renuy renuy added carvel accepted This issue should be considered for future work and that the triage process has been completed and removed carvel triage This issue has not yet been reviewed for validity labels Jul 28, 2021
@renuy
Copy link
Contributor

renuy commented Jul 28, 2021

We will add the flag and show warnings (true) by default.

@danielhelfand
Copy link
Contributor Author

We will add the flag and show warnings (true) by default.

Would it make sense to change the flag then? To something like --silence-deprecation-notices with a default of false? I think the UX is a bit better to me this way.

@praveenrewar
Copy link
Member

praveenrewar commented Jul 29, 2021

Would it make sense to change the flag then? To something like --silence-deprecation-notices with a default of false? I think the UX is a bit better to me this way.

I agree, this is also in line with Go's default value for bool.

also we should only show same warning once to the user.

Or, we can show a message to users along with the warnings, that they can silence them by using this flag.

@praveenrewar praveenrewar self-assigned this Jul 30, 2021
@renuy renuy linked a pull request Aug 18, 2021 that will close this issue
cppforlife pushed a commit that referenced this issue Aug 20, 2021
* Add --no-deprecation-warning flag
* Update --no-deprecation-warnings to --warnings
* Add new warning handler with deduplication
* Add ui adapter, update test cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants