Open richardvflux opened 2 months ago
It seems it's caused by the rest/create.go which make the name initialized earlier in the create process。(https://github.com/kubernetes/kubernetes/commit/af9d36f9310bc3c21791bf17470a667b690573b0)
if len(objectMeta.GetGenerateName()) > 0 && len(objectMeta.GetName()) == 0 {
return errors.NewInternalError(fmt.Errorf("metadata.name was not generated"))
}
A straight forward fix will be to generate name before invoking rest.BeforeCreate in validator.go. I'll open a PR.
/assign
Currently facing this issue as well. Thanks for your PR
What happened?
With a job, we set only the "generatedName" value as recommended by Argo https://argo-cd.readthedocs.io/en/stable/user-guide/resource_hooks/#using-a-hook-to-send-a-slack-message - however on rendered validation, it fails because there is no name. Having no name is valid it appears if generatedName is set https://kubernetes.io/docs/reference/using-api/api-concepts/#generated-values
What did you expect to happen?
validation to pass
How can we reproduce it (as minimally and precisely as possible)?
use the sample Argo resource as an example
Anything else we need to know?
nope!
Kubernetes version