kubeval icon indicating copy to clipboard operation
kubeval copied to clipboard

Issues with Kustomization Files

Open mmckane opened this issue 4 years ago • 3 comments

Kustomization.yaml files currently throws errors when scanned. This may be expected but seeing some strange behavior with several of the switches when I try and ignore them.

Error I am seeing consistently: ERR - path/kustomization.yaml: Missing 'metadata' key

Things tried to resolve missing metadata key: --ignore-missing-schemas = Still results in above error --skip-kinds Kustomization = Does not appear to be working, would be nice to have this work as there are a few types of possible names for these types of files.

Current Workaround: --ignored-filename-patterns kustomization.yaml seems to be the only way to ignore these files.

example file for reference:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- github.com/argoproj/argo-cd/manifests/ha/cluster-install?ref=v1.5.2

mmckane avatar May 02 '20 03:05 mmckane

I was searching for the schema to check what might be actually happening; found https://github.com/instrumenta/kubeval/issues/209#issue-558193908 , but the link is dead. Anyone can point to the schema to help fix this?

blaggacao avatar Jul 20 '20 20:07 blaggacao

@blaggacao It looks like the json schema site isn't being updated anymore (last update 17 months ago!). Here's a go based version, would this work? https://pkg.go.dev/sigs.k8s.io/kustomize/api/types or https://github.com/kubernetes-sigs/kustomize/blob/master/api/types/kustomization.go

cprivitere avatar Aug 25 '21 16:08 cprivitere

You can use this command-line flag and argument to ignore these files: --ignored-filename-patterns='^(?:.+/)?(?:Kustomization|kustomization\.ya?ml)$'

seh avatar Oct 18 '21 13:10 seh