banzaicloud / istio-operator

An operator that manages Istio deployments on Kubernetes
Apache License 2.0
535 stars 94 forks source link

fixes #919 #920

Closed Tanemahuta closed 1 year ago

Tanemahuta commented 1 year ago
Q A
Bug fix? no
New feature? yes
API breaks? no
Deprecations? yes
Related tickets fixes #919
License Apache 2.0

What's in this PR?

Changed resource version of HorizontalPodAutoscaler to v2

Why?

Group deprecation in k8s 1.27

Additional context

none

Checklist

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

Tanemahuta commented 1 year ago

Since the HorizontalPodAutoscaler v2beta2 is deprecated since 1.23, I have taken the shortcut and replaced the group version.

waynz0r commented 1 year ago

Hi,

I suggest to use the following to be backward compatible:


apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }}
Tanemahuta commented 1 year ago

Downside: some IDEs (e.g. IntelliJ IDEA in my case) will not properly recognize GVK If you plan to use beta features and support previous API versions, you might want to create a helper for this. Pushed a new commit.