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

Adding kapp waiting behavior for kapp-controller CRDs (PackageRepo, PackageInstall) #245

Merged
merged 5 commits into from
Jul 26, 2021

Conversation

danielhelfand
Copy link
Contributor

@danielhelfand danielhelfand commented Jul 9, 2021

Closes #237

Adds waiting behavior for kapp-controller PackageInstall/PackageRepository CRs. Upgrades k8s dependencies for kapp-controller module import.

Also, silences deprecation notices introduced with upgrade to v0.19.2 of client-go: https://kubernetes.io/blog/2020/09/03/warnings/. Introducing a custom client handling approach to make ignoring deprecation notices the default. Open to enabling a flag to show deprecation notices if user wants to see warnings.

@danielhelfand
Copy link
Contributor Author

There seems to be an interesting dependency issue in introducing these changes:

  1. Importing kapp-controller module v0.20.0 bumps many k8s dependencies to v0.19.2
  2. Updating kapp to use v0.19.2 introduces an issue with logging where deprecation warning are returned with requests to the k8s API (e.g. W0708 19:35:43.776959 44071 warnings.go:67] coordination.k8s.io/v1beta1 Lease is deprecated in v1.19+, unavailable in v1.22+; use coordination.k8s.io/v1 Lease)
  3. Downgrading to a version of client-go that does not include these warnings (v0.18.0) works in resolving the warnings in stdout but introduces a problem with Lower-case OpenAPIv2 and OpenAPIv3 dirs to follow style guide. google/gnostic#155 which was resolved in v0.19.0 of client-go.

@danielhelfand danielhelfand marked this pull request as ready for review July 12, 2021 22:17
@danielhelfand danielhelfand changed the title WIP: Adding kapp waiting behavior for kapp-controller CRDs (PackageRepo, PackageInstall) Adding kapp waiting behavior for kapp-controller CRDs (PackageRepo, PackageInstall) Jul 12, 2021
@@ -38,7 +38,12 @@ func (f *DepsFactoryImpl) DynamicClient() (dynamic.Interface, error) {
return nil, err
}

clientset, err := dynamic.NewForConfig(config)
// copy to avoid mutating the passed-in config
Copy link
Contributor

Choose a reason for hiding this comment

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

out of curiosity what kind of deprecation notes were you seeing? i think we may want to surface those, but that might be a separate feature (from this PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Full warnings output is below. This is run against a v1.20.0 k8s cluster.

I mentioned in the pr description that we could maybe include a flag that would show warnings and somehow format the output in a more user friendly way than what is show below. But by default, I think it makes sense to hide them. Agree that is should probably be a separate feature from this pr.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, more information in this blog post on the warnings: https://kubernetes.io/blog/2020/09/03/warnings/.

danielhelfand added a commit to carvel-dev/kapp-controller that referenced this pull request Jul 20, 2021
danielhelfand added a commit to carvel-dev/kapp-controller that referenced this pull request Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add waiting behavior for PackageRepository/PackageInstalls
3 participants