Skip to content

Kustomize plugin fails with deprecation warnings #639

@eriknelson

Description

@eriknelson
SUMMARY

Kustomize Version: 5.1.0

I'm attempting to use the kustomize plugin to render a manifest and getting the following error:

---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: metallb-system
resources:
  - github.com/metallb/metallb/config/native?ref=v0.13.10

Error output:

fatal: [localhost]: FAILED! => {
    "msg": "kustomize command failed with: # Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.\n# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.\n"
}

Stepping through the code, it looks like the deprecation warnings are present in stderr, and the plugin simply looks for the presence of the error without any additional nuance. I confirmed that out in this case actually contains the manifest that I'm looking for.

I think my expectation here would be to delegate to the user whether or not to treat deprecation warnings as errors maybe with a switch, with a stricter default of True, but at least that would give me a path to ignoring these.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Kustomize lookup plugin

ANSIBLE VERSION
ansible [core 2.15.0]
  config file = None
  configured module search path = ['/home/ernelson/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /git/nexus.workloads/.venv/lib/python3.11/site-packages/ansible
  ansible collection location = /home/ernelson/.ansible/collections:/usr/share/ansible/collections
  executable location = /git/nexus.workloads/.venv/bin/ansible
  python version = 3.11.4 (main, Jun  9 2023, 14:24:46) [GCC 13.1.1 20230429] (/git/nexus.workloads/.venv/bin/python)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION

Affected collection version: 2.4.0

I'm also seeing this on main.

CONFIGURATION
CONFIG_FILE() = None
EDITOR(env: EDITOR) = nvim
PAGER(env: PAGER) = less
OS / ENVIRONMENT

Arch Linux

STEPS TO REPRODUCE
  • Create the manifest above in metallb/
  • Run a play with the following task:
- name: Set workload dir
  set_fact:
    workload_dir: "metallb"
- name: Render kustomize
  set_fact:
    manifest: "{{lookup('kubernetes.core.kustomize', dir=workload_dir)}}"
EXPECTED RESULTS

Expecting to have the contents of the manifest in the manifest var.

ACTUAL RESULTS

Error seen in summary

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions