20cf2db961
This is an update to address a behavior change introduced with 0ae8f4d21ac2a091f1612e50f4786da5065d4398. Job labels if empty/unspecified are taken from the template. If (any) labels are specified on the job we do not get this behavior. Specifically if we *apply*: apiVersion: batch/v1 kind: Job metadata: # no "labels:" here name: placement-db-init namespace: openstack spec: template: metadata: labels: application: placement component: db-init release_group: placement spec: containers: # do stuffs then *query* we see: apiVersion: batch/v1 kind: Job metadata: # k8s did this for us! labels: application: placement component: db-init job-name: placement-db-init release_group: placement name: placement-db-init namespace: openstack spec: template: metadata: labels: application: placement component: db-init release_group: placement spec: containers: # do stuffs The aforementioned change causes objects we apply and query to look like: apiVersion: batch/v1 kind: Job metadata: # k8s did this for us! labels: application: placement # nothing else! name: placement-db-init namespace: openstack spec: template: metadata: labels: application: placement component: db-init release_group: placement spec: containers: # do stuffs Current users rely on this behavior and deployment systems use job labels for synchronization, those labels being only specified in the template and propagating to the job. This change preserves functionality added recently and restores the previous behavior. The explicit "application" label is no longer needed as the helm-toolkit.snippets.kubernetes_metadata_labels macro provides it. Change-Id: I1582d008217b8848103579b826fae065c538aaf0