Migrate MetalLB annotations to the metallb.io domain
org.openrewrite.kubernetes.metallb.MigrateMetalLbAnnotationPrefixArtifactorg.openrewrite.recipe:rewrite-kubernetesRename the MetalLB Service annotations that moved from the metallb.universe.tf domain to metallb.io in MetalLB 0.14.9. The old domain still works, but the controller now raises a deprecatedAnnotation event against every service using it and the release notes reserve the right to drop the compatibility shim. Only the four annotations that genuinely moved are renamed — address-pool, loadBalancerIPs, allow-shared-ip and the controller-written ip-allocated-from-pool — so an unrelated metallb.universe.tf key keeps its domain.
MetalLB prefers the metallb.io spelling wherever both are present, which makes the deprecated twin dead weight. Such a twin is dropped when it carries the same value and reported otherwise, rather than renamed into a duplicate key.
This is MetalLB's own annotation domain, not a Kubernetes API migration; a cluster load balanced by anything else is unaffected.
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.kubernetes.metallb.MigrateMetalLbAnnotationPrefixIf the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-kubernetes:RELEASEOptions
| Name | Type | Description |
|---|---|---|
fileMatcher | String | Matching files will be modified. This is a glob expression. e.g. **/service-*.yml |
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats