openrewrite / rewrite-kubernetes

OpenRewrite recipes for Kubernetes.
Apache License 2.0
9 stars 8 forks source link

Recipes for the Deprecated API Migration Guide #59

Open timtebeek opened 1 week ago

timtebeek commented 1 week ago

What problem are you trying to solve?

New versions of Kubernetes come with necessary migration steps, as documented on: https://kubernetes.io/docs/reference/using-api/deprecation-guide/

It would be great to have (mostly) declarative recipes to apply these necessary migration steps per version, chained together to apply all necessary intermediate changes. This would be similar to the structure we have for rewrite-android.

Best to start with just the outline of API versions that have breaking changes (v1.32, v1.29, v1.27, ...), and then from there fill out the necessary migration steps through most likely the use of MergeYaml .

timtebeek commented 1 week ago

This would need to be extended to cover API versions further back, as listed on the migration guide, as well as additional steps, like this one, which was implemented in https://github.com/openrewrite/rewrite-kubernetes/commit/fd23638fbaf6ede16bd8d45f53684a88ec536e85.

Notable changes in flowcontrol.apiserver.k8s.io/v1: The PriorityLevelConfiguration spec.limited.assuredConcurrencyShares field is renamed to spec.limited.nominalConcurrencyShares and only defaults to 30 when unspecified, and an explicit value of 0 is not changed to 30.

We welcome anyone to contribute additional such steps, using the building block recipes available from: https://docs.openrewrite.org/recipes/yaml