Skip to content

Failed Validation Resource Tests When using Kustomize patches and patchesJson6902 #1596

@nakfour

Description

@nakfour

As part of the Openshift stack in #1567 we are using patches and patchesJson6902. Running the tests from the manifest test folder fails with error

=== RUN   TestCheckWebhookSelector
--- FAIL: TestCheckWebhookSelector (0.74s)
    validate_resources_test.go:314: Error unmarshaling ../stacks/openshift/application/katib/katib-controller-deployment.yaml; error: wrong Node Kind for  expected: MappingNode was SequenceNode: value: {- op: add
          path: /spec/template/spec/containers/0/args/-
          value: '--webhook-inject-securitycontext=true'}

Our patches in the kustomize file looks like this

patchesJson6902:
 - target:
   group: apps
   version: v1
   kind: Deployment
   name: katib-controller
 path: katib-controller-deployment.yaml

katib-controller-deployment.yaml

- op: add
  path: /spec/template/spec/containers/0/args/-
  value: '--webhook-inject-securitycontext=true'

This could be related to kpt issue that was never resolved here: kptdev/kpt#506
What is the workaround for this? The inline suggested workaround in the kpt issue did not work

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions