kustomize
kustomize copied to clipboard
Kustomize doesn't support metadata.generateName
I am trying to use kustomize with https://github.com/argoproj/argo.
Example spec:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: hello-world-
spec:
entrypoint: whalesay
templates:
- name: whalesay
container:
image: docker/whalesay:latest
command: [cowsay]
args: ["hello world"]
Argo Workflow CRDs don't require or use metadata.name, but I am getting the following error when I try to run kustomize build on an Argo Workflow resource:
Error: loadResMapFromBasesAndResources: rawResources failed to read Resources: Missing metadata.name in object {map[args:[hello world] kind:Workflow metadata:map[generateName:hello-world-] spec:map[entrypoint:whalesay templates:[map[container:map[command:[cowsay] image:docker/whalesay:latest] name:whalesay]]] apiVersion:argoproj.io/v1alpha1]}
Is there a way for me to override where kustomize looks for a name to metadata.generateName?
Similar issues #627, #586
#627 is about names, but currently i see it as a feature request.
This bug and #586 are noting that kustomize doesn't recognize the kubernetes API directive generateName, which is indeed a bug.
This directive is a kustomize-like feature introduced before kustomize... (complicating our life).
We might try to allow it and work with it - or disallow it and provide an alternative mechanism.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten
/remove-lifecycle rotten
I wanted to use generateName with kustomize but I can't :(
I wanted to use generateName with kustomize too.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopen. Mark the issue as fresh with/remove-lifecycle rotten.Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
This issue should be reopened unless it has been solved and the docs don't show it.
Agreed, let's re-open and solve the issue.
anybody can open with @k8s-ci-robot robot command. I've already opened, I don't want to flood it :)
/reopen
I've just stumbled across this issue as well, and would appreciate a fix or an alternative mechanism (as mentioned by monopole above).
@haimberger: You can't reopen an issue/PR unless you authored it or you are a collaborator.
In response to this:
/reopen
I've just stumbled across this issue as well, and would appreciate a fix or an alternative mechanism (as mentioned by monopole above).
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/reopen
sigh.
@Datamance: You can't reopen an issue/PR unless you authored it or you are a collaborator.
In response to this:
/reopen
sigh.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Can someone with The Power reopen this? Still outstanding AFAICT.
/remove-lifecycle rotten
The workaround I've used for Argo specifically is to define my workflow with a name:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: hello-world-
spec:
...
And then tell Kustomize to move that to generateName as the last patch:
resources:
- hello-world.yaml
patches:
- patch: |-
- op: move
from: /metadata/name
path: /metadata/generateName
target:
kind: Workflow
This is obviously not very good, but it does let us use Kustomize with Argo (and without writing a Kustomize plugin).
I've just faced this issue using Spinnaker as well because Spinnaker is updated to 1.20.0 and Kubernetes Job behavior is changed to use metadata.generateName filed instead of metadata.name.
In this case, kustomize build fails for missing metadata.name.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
Is there any progress?
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale
/remove-lifecycle stale
The workaround I've used for Argo specifically is to define my workflow with a
name:apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: name: hello-world- spec: ...And then tell Kustomize to move that to
generateNameas the last patch:resources: - hello-world.yaml patches: - patch: |- - op: move from: /metadata/name path: /metadata/generateName target: kind: WorkflowThis is obviously not very good, but it does let us use Kustomize with Argo (and without writing a Kustomize plugin).
But we need to change the generateName to name not the other way around. I tried this but still get the same error, metadata.name missing
Is there a progress update on this? It seems like a pretty big limitation. Not being able to us Kustomize with CRDs such as those in Argo Workflows is a huge drawback.