Skip to content

How to change the labels of nodes? #523

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

Closed
divramod opened this issue Oct 9, 2020 · 2 comments
Closed

How to change the labels of nodes? #523

divramod opened this issue Oct 9, 2020 · 2 comments

Comments

@divramod
Copy link

divramod commented Oct 9, 2020

Hey,

thx for the awesome project!

I'd like to change the labels of nodes programmatically.
Can someone give me a hint on where to start with that task?

@brendandburns
Copy link
Contributor

The easiest way to do this is

  1. obj = api.readNode(...)
  2. `obj.metadata.labels[some-key] = some-new-value;
  3. api.replaceNode(obj)

You can also us patch similar to the patch example here:
#508

Hope that helps.

@brendandburns
Copy link
Contributor

Closing since I think this is resolved, please use /reopen if you need further asssitance.

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

No branches or pull requests

2 participants