The version of Kustomize (version 5) has changed on the latest version of the build agents released last week (https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml and https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md). We haven't been able to use our pipelines since. We have checked the release notes and breaking changes but can't spot the problem (not that we are Kustomize experts).
Either kustomize build
commands run as part of a pipeline
parameters:
- name: environmentOverlay
displayName: Name of the environment overlay (e.g. sandbox, qa, uat, prod)
type: string
- name: kubernetesNamespace
displayName: Name of the kubernetes namespace
type: string
- name: image
displayName: The container image to use
type: string
steps:
- script: kustomize build $(Pipeline.Workspace)/Manifests/overlays/${{ parameters.environmentOverlay }} > $(Pipeline.Workspace)/baked.yaml
displayName: Bake environment specific manifest
- task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster
inputs:
action: deploy
namespace: ${{ parameters.kubernetesNamespace }}
manifests: $(Pipeline.Workspace)/baked.yaml
containers: ${{ parameters.image }}
Or those run as part of bash fail with the error
Error: invalid Kustomization: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go struct field Kustomization.patches of type types.Patch
Is anyone else encountering this problem and what's the secret?! We have tried numerous different patch
syntax