kudobuilder / kudo

Kubernetes Universal Declarative Operator (KUDO)
https://kudo.dev
Apache License 2.0
1.18k stars 103 forks source link

Move warning options to 'GetKubeClientForConfig' #1716

Closed nfnt closed 4 years ago

nfnt commented 4 years ago

What this PR does / why we need it: As this function is used by more functions to create Kubernetes clients, more KUDO subcommands will benefit from reduced CRD deprecation warnings when running on Kubernetes >=1.19.

Before:

$ kubectl kudo get instances
W1015 13:21:29.812992    1507 warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
W1015 13:21:29.816993    1507 warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
W1015 13:21:29.820192    1507 warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
List of current installed instances in namespace "default":
.

After:

$ kubectl kudo get instances
Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
List of current installed operators including versions and instances in namespace "default":
.