Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add/remove labels to resources of same kind #158

Open
AmitKumarDas opened this issue Oct 20, 2020 · 1 comment
Open

feat: add/remove labels to resources of same kind #158

AmitKumarDas opened this issue Oct 20, 2020 · 1 comment
Labels

Comments

@AmitKumarDas
Copy link

ProblemStatement: As a SRE admin, I want to add or remove labels against resources based on resource names or resource labels

@AmitKumarDas
Copy link
Author

AmitKumarDas commented Oct 20, 2020

Draft Design

kind: Recipe
spec:
  tasks:
  - applyLabels:
      labels:
        app: dope
      # optional include
      include:
      - node1
      - node2
      # optional exclude
      exclude:
      - node3
      state:
        kind: Node
        metadata:
          # optional label selector
          labels:
            arch: amd64

NOTE:

  • step 1 - state will select all possible nodes based on its metadata.labels (if any)
  • step 2 - include will filter from list due to step 1
    • if include is nil then there will not be any filtering
  • step 3 - exclude will exclude from list due to step 1
    • if exclude is nil then there will not be any filtering
  • include & exclude should not be used together
  • final step
    • app: dope will be set against the final list
    • if step 1 list contain resource(s) with app: dope & its not present in include then app:dope will be unset from the resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant