argo-rollouts
argo-rollouts copied to clipboard
Rollout `spec.template.metadata.name` is an invalid field, breaking compatibility with apps/v1 Deployment
Checklist:
- [x] I've included steps to reproduce the bug.
- [x] I've included the version of argo rollouts.
Describe the bug
Creating/Updating a rollout with spec.template.metadata.name
field set causes the following client side validation error:
Error: UPGRADE FAILED: error validating "": error validating data: ValidationError(Rollout.spec.template.metadata): unknown field "name" in io.argoproj.v1alpha1.Rollout.spec.template.metadata
However setting the same field in the apps/v1
Deployment
causes no issue. Disabling client validation succeeds.
I understand setting the field has no effect on the final deployment object, but the field cannot be removed from our workflow as we set the same default metadata
object (name, labels, annotations) on all resources in our clusters.
Docs state:
Template describes the pods that will be created. Same as deployment.
To Reproduce
-
kubectl apply
the snippet and observe the valid Deployment - Change the apiVersion/kind to ArgoRollout, and try to apply. Observe the validation error
- Comment out the
spec.template.spec.metadata.name
field and try to apply again, and observe success
apiVersion: apps/v1
kind: Deployment
# apiVersion: argoproj.io/v1alpha1
# kind: Rollout
metadata:
name: test
spec:
selector:
matchLabels:
app: test
template:
metadata:
name: test
labels:
app: test
spec:
containers:
- name: test
image: argoproj/rollouts-demo:blue
Expected behavior
Argo Rollout spec.template.spec
should be fully interchangable with Deployment (POD) spec
Version
v1.5.0
Logs
Logs are N/A, this is a client side validation issue
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.
- Argo Rollouts uses k8s.io/api/core/v1 PodTemplateSpec as seen here...
- PodTemplateSpec uses k8s.io/apimachinery/pkg/apis/meta/v1 ObjectMetadata, as seen here...
- ObjectMetdata has a name field, as seen here!
So why does the generated CRD not have the name field, since it seems to be in the golang struct?
This issue is stale because it has been open 60 days with no activity.
Continued the discussion a bit on the PR: https://github.com/argoproj/argo-rollouts/pull/3068#issuecomment-1747662029
I'd love to see this fixed to include all ObjectMeta
fields, we're hitting this issue with creationTimestamp
. I'm really curious what is excluding these fields from the generated CRDs?