Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Label the sub-templates in the container resources (e.g. pods in jobs) #107

Closed
nolar opened this issue Jun 12, 2019 · 0 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@nolar
Copy link
Contributor

nolar commented Jun 12, 2019

Actual Behavior

When I create a job, and label it with some parent-referencing labels, I expect the labels to be also applied to the pod templates:

kopf.label(job, {'parent-name': name})

The pod template lacks the labels, only the parent job objects gets it.

One way to work around this is to explicitly label the job and its template:

kopf.label(job, {'parent-name': name})
kopf.label(job['spec']['template'], {'parent-name': name})

Expected Behavior

However, it would be better to do in one call:

# Explicitly:
kopf.label(job, {'parent-name': name}, nested=['spec.template'])

# Auto-guessing:
kopf.label(job, {'parent-name': name}, recursive=True)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant