-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Support skipping kind/name #255
Comments
After some thoughts, this may not be useful at all as kustomize should catch those errors when building. I'll let this open in case someone comes up with a situation where this would be useful; otherwise feel free to close it. |
I have a use-case: With FluxCD it is possible to define patches for specific targets (specified by group, version, kind, label, etc...). For example, I can patch some default / constant properties that I want certain resource to re-use by default. apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: my-app
namespace: flux-system
spec:
path: <...>
interval: 60m
timeout: 5m
retryInterval: 3m
force: true
prune: true
wait: true
sourceRef:
kind: GitRepository
name: flux-system
I can write a patch like this apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: apps
namespace: flux-system
spec:
...
patches:
- target:
group: kustomize.toolkit.fluxcd.io
version: v1
kind: Kustomization
patch: |-
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: an-app
spec:
interval: 60m
timeout: 5m
retryInterval: 3m
force: true
prune: true
wait: true
sourceRef:
kind: GitRepository
name: flux-system And then I just define apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: my-app
namespace: flux-system
spec:
path: <...> The issue is that then Kubeconform will complain about missing required properties:
And there isn't (to my knowledge yet) a way to run this patch manually. Setting |
In our workflow, we first build the kustomization and then validates the built file. This is useful when working with Kustomize patches that modify the end resource. That means however that all resources end up in the same yaml file.
With the current skip skip options, there is only the possibility to skip either a file, a version/kind or a kind. The file cannot be skipped as it is the result of a
kustomize build
, and the kind cannot be skipped as it would skip all other resources of the same kind in the file.For example, let's say we want to skip an nginx deployment within the file. It would be helpful to be able to skip v1/Deployment/nginx.
The text was updated successfully, but these errors were encountered: