Chris Wedgwood 20cf2db961 [htk] Jobs; put labels only in the template spec
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
2021-04-02 16:54:03 -05:00
2021-03-09 16:54:45 +00:00
2021-02-10 16:01:07 -06:00
2021-03-02 16:44:55 +08:00
2020-09-11 18:02:38 +03:00
2021-03-01 22:55:14 +00:00
2021-02-08 16:52:01 +00:00
2021-03-17 17:06:07 -07:00
2021-03-02 16:10:24 +00:00
2019-04-19 19:34:11 +00:00
2020-04-11 15:26:50 +02:00
2018-05-15 13:04:28 -05:00

Openstack-Helm-Infra

Mission

The goal of OpenStack-Helm-Infra is to provide charts for services or integration of third-party solutions that are required to run OpenStack-Helm.

For more information, please refer to the OpenStack-Helm repository.

Communication

  • Join us on IRC: #openstack-helm on freenode
  • Community IRC Meetings: [Every Tuesday @ 3PM UTC], #openstack-meeting-alt on freenode
  • Meeting Agenda Items: Agenda
  • Join us on Slack
    • #openstack-helm

Contributing

We welcome contributions. Check out this document if you would like to get involved.

Description
Repository for OpenStack Helm infrastructure-related code
Readme 67 MiB