← All recipes
Moderne licensed

Find custom resources using deprecated CRD fields

Recipe IDorg.openrewrite.kubernetes.crd.FindCustomResourcesUsingDeprecatedCrdFieldsArtifactorg.openrewrite.recipe:rewrite-kubernetes

Find custom resources that set a field which a CustomResourceDefinition in this repository marks deprecated, or that are on a version the CustomResourceDefinition deprecates. controller-gen copies Go doc comments verbatim into a CRD's OpenAPI schema description, so a field deprecated in Go ships its own deprecation notice inside the CRD and no per-CRD configuration is needed.

Single recipeProprietary

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.crd.FindCustomResourcesUsingDeprecatedCrdFields

If the recipe isn’t available locally, install it with:

mod config recipes jar install org.openrewrite.recipe:rewrite-kubernetes:RELEASE

Options

NameTypeDescription
sensitivityStringstrict, the default, recognizes only the Go convention of a description whose line begins with Deprecated and a separator. loose additionally accepts is deprecated, has been deprecated and will be removed in anywhere in a description, at the cost of reporting prose that merely mentions a deprecation.
e.g. loose
additionalMarkerPatternStringA regular expression matched against a property's description in addition to the built-in markers, for house deprecation conventions.
e.g. @deprecated

Data tables

Structured output this recipe can produce.

  • Deprecated CRD field usagesCustom resources that use something a CustomResourceDefinition in this repository marks deprecated.org.openrewrite.kubernetes.table.DeprecatedCrdFieldUsages
  • 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