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

Set name metadata correctly for prom rules #160

Closed
wants to merge 1 commit into from

Conversation

malcolmholmes
Copy link
Collaborator

Here, uid is $NAMESPACE.$NAME. We should not set the name to that.

Currently, if we re-render a UID we will get $NAMESPACE.$NAMESPACE.$NAME.

This PR corrects this error by setting the name to just group.name. The
namespace is set in metadata in the next line.

Copy link
Collaborator

@dsotirakis dsotirakis left a comment

Choose a reason for hiding this comment

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

LGTM, nit comment.
Also, tests need tweaking :)

@@ -52,7 +52,7 @@ func getRemoteRuleGroup(uid string) (*grizzly.Resource, error) {
"rules": group.Rules,
}
handler := RuleHandler{}
resource := grizzly.NewResource(handler.APIVersion(), handler.Kind(), uid, spec)
resource := grizzly.NewResource(handler.APIVersion(), handler.Kind(), group.Name, spec)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reeeeeeeeally nit, but we can use name instead of group.Name since we have already extracted the var

@malcolmholmes
Copy link
Collaborator Author

fixed in a different PR

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

Successfully merging this pull request may close these issues.

None yet

2 participants