Skip to content

Another potential issue around kind:Namespace #5192

@pb-adrianbezzina

Description

@pb-adrianbezzina

What happened?

I have the following manifest:

apiVersion: servicebus.azure.com/v1api20210101preview
kind: Namespace
metadata:
  name: servicebus
spec:
  azureName: servicebus
  location: australiaeast

and with a transformer configured like so:

apiVersion: builtin
kind: PrefixSuffixTransformer
metadata:
  name: AzureNamePostfix
suffix: -devtest
fieldSpecs:
  - path: spec/azureName

The transformation doesn't apply after a kustomize build - and the original manifest is the end result of the build

Seems to be similar to issue #5072 where having a resource of KIND namespace is confusing the kustomize command - if this is found to be a issue - would be wise to check all places there is logic around Kind: Namespace

What did you expect to happen?

Manifest:

apiVersion: servicebus.azure.com/v1api20210101preview
kind: Namespace
metadata:
  name: servicebus
spec:
  azureName: servicebus
  location: australiaeast

and with a transformer configured like so:

apiVersion: builtin
kind: PrefixSuffixTransformer
metadata:
  name: AzureNamePostfix
suffix: -devtest
fieldSpecs:
  - path: spec/azureName

New Manifest:

apiVersion: servicebus.azure.com/v1api20210101preview
kind: Namespace
metadata:
  name: servicebus
spec:
  azureName: servicebus-devtest
  location: australiaeast

How can we reproduce it (as minimally and precisely as possible)?

# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - resources.yaml
transformers:
  - env.yaml
# resources.yaml
apiVersion: servicebus.azure.com/v1api20210101preview 
kind: Namespace
metadata:
  name: servicebus
spec:
  azureName: servicebus
  location: australiaeast
# env.yaml
apiVersion: builtin
kind: PrefixSuffixTransformer
metadata:
  name: AzureNamePostfix
suffix: -devtest
fieldSpecs:
  - path: spec/azureName

Expected output

apiVersion: servicebus.azure.com/v1api20210101preview 
kind: Namespace
metadata:
  name: servicebus
spec:
  azureName: servicebus-devtest
  location: australiaeast

Actual output

apiVersion: servicebus.azure.com/v1api20210101preview 
kind: Namespace
metadata:
  name: servicebus
spec:
  azureName: servicebus
  location: australiaeast

Kustomize version

5.0.3

Operating system

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions