hierarchical-namespaces
hierarchical-namespaces copied to clipboard
Add labels/annotations to the subnamespace (or its anchor) at creation time
Hello,
I would like to be able to define labels/annotations for a new subnamespace at the time it is created. Something along the lines of:
kubectl hns create -n parent child --annotation foo=bar --annotation baz=qux --label tata=titi --label toto=tutu
Currently, this requires first creating the subnamespace, then updating it to add the annotations/labels. I was hoping that the two operations could be merged into one.
What do you think?
The raw capability for this already exists: the SubnamespaceAnchor
has label and annotation fields here. Adding command-line flags to kubectl-hns
to populate those seems like a good idea and quite easy to do - please feel free to add that!
@adrianludwin Using SubnamespaceAnchor and trying to add metadata.labels does not work, it does not add the labels, instead the labels have to be added after the namespaces have already been created - which is the original issue. See #323 .
Sorry for the delay - you need to use spec.labels
, not metadata.labels
, see my latest comment in #323.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle stale
- Close this issue with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle stale
- Close this issue with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale