Skip to content

ArgoCD injected app-name does not play nice with apps/v1beta1 deployment specs #335

Closed
@jessesuen

Description

In kubernetes, if a deployment spec is of version, apps/v1beta1, and spec.selector is omitted, k8s will default the spec.selector to match spec.template.metadata.labels

Because of this defaulting behavior, if we ever deploy an apps/v1beta1 manifest where spec.selector is unset, the ArgoCD labels will make it into spec.selector. This causes problems if an application is ever recreated with a new name (with cascade=false).

I think we need to handle this gracefully. Not clear what the solution should be, but we should not allow our label to get into spec.selector.

NOTE: this behavior of defaulting of the spec.selector was removed in apps/v1beta2.

Relevant: kubernetes/kubernetes#57606

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions