-
Couldn't load subscription status.
- Fork 250
Propogate user defined labels on the RGI to resources #229
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Arsh Sharma <[email protected]>
Signed-off-by: Arsh Sharma <[email protected]>
|
@a-hilaly I wasn't able to figure out where to write the tests for this, can you please point me in the right direction? |
Signed-off-by: Arsh Sharma <[email protected]>
|
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-contributor-experience at kubernetes/community. /check-cla |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @RinkiyaKeDad ! left a few minors below
| igr.log.V(1).Info("Creating new resource", "resourceID", resourceID) | ||
|
|
||
| // Check if label propagation is enabled | ||
| annotations, found := igr.runtime.GetInstance().Object["metadata"].(map[string]interface{})["annotations"].(map[string]interface{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| annotations, found := igr.runtime.GetInstance().Object["metadata"].(map[string]interface{})["annotations"].(map[string]interface{}) | |
| annotations := igr.runtime.GetInstance().GetAnnotations() |
|
|
||
| func (igr *instanceGraphReconciler) propagateLabelsToResource(resource *unstructured.Unstructured) { | ||
| // Get labels from the RGI | ||
| rgiLabels, found := igr.runtime.GetInstance().Object["metadata"].(map[string]interface{})["labels"].(map[string]interface{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
This PR allows the user to propogate the labels they have set on the Resource Group Instance by using setting the
kro.run/propagate-labels: "true"annotation.Fixes #184
Sample RGI to try it out with:
Use the RG from the getting started guide with this.