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

Label sub-templates recursively #108

Merged
merged 5 commits into from
Jun 13, 2019

Conversation

nolar
Copy link
Contributor

@nolar nolar commented Jun 12, 2019

Issue : #107, indirectly #13

Now, it is a bit easier to label both the created object (e.g. jobs) and its sub-templates (e.g. pods in jobs):

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

Also, few tests added on the utility functions used internally, just to be sure they work as expected.

The auto-guessing on which sub-fields are templates, which are not (as suggested in #107) is skipped for now — that might require enumerating the kinds&fields from the docs.

Types of Changes

  • New feature (non-breaking change which adds functionality)

@nolar nolar added enhancement New feature or request automation CI/CD: testing, linting, releasing automatically labels Jun 12, 2019
@nolar nolar requested a review from samurang87 as a code owner June 12, 2019 11:46
@zincr
Copy link

zincr bot commented Jun 12, 2019

🤖 zincr found 0 problems , 0 warnings

✅ Large Commits
✅ Approvals
✅ Specification
✅ Dependency Licensing

@zincr
Copy link

zincr bot commented Jun 12, 2019

🤖 zincr found 1 problem , 0 warnings

❌ Approvals
✅ Large Commits
✅ Specification
✅ Dependency Licensing

Details on how to resolve are provided below


Approvals

All proposed changes must be reviewed by project maintainers before they can be merged

Not enough people have approved this pull request - please ensure that 1 additional user, who have not contributed to this pull request approve the changes.

  • ✅ Approved by PR author @nolar
  • ❌ 1 additional approval needed
     

1 similar comment
@zincr
Copy link

zincr bot commented Jun 12, 2019

🤖 zincr found 1 problem , 0 warnings

❌ Approvals
✅ Large Commits
✅ Specification
✅ Dependency Licensing

Details on how to resolve are provided below


Approvals

All proposed changes must be reviewed by project maintainers before they can be merged

Not enough people have approved this pull request - please ensure that 1 additional user, who have not contributed to this pull request approve the changes.

  • ✅ Approved by PR author @nolar
  • ❌ 1 additional approval needed
     

pass
elif isinstance(objs, collections.abc.Iterable):
for obj in objs:
yield from walk(obj, nested=nested)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must be the first time I see recursion in "real" code!

@nolar nolar merged commit 18d6a81 into zalando-incubator:master Jun 13, 2019
@nolar nolar deleted the recursive-labelling branch June 13, 2019 16:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automation CI/CD: testing, linting, releasing automatically enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants