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

Add GetUID function to resource object #159

Merged
merged 2 commits into from
Aug 27, 2021

Conversation

malcolmholmes
Copy link
Collaborator

The new tests have shown up some naming issues.

We have resource.Name(), which extracts metadata.name, but this is not
the resource's UID, which in some cases needs to be a compound element, e.g.
$NAMESPACE.$NAME for a PrometheusRuleGroup or $TYPE.$JOB for a
SyntheticMonitoringCheck.

This PR adds a GetUID() function that correctly returns a UID across all
resource types.

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, but it would be also nice to add some unit tests, at least for the funcs that have conditions in them :)

@malcolmholmes
Copy link
Collaborator Author

LGTM, but it would be also nice to add some unit tests, at least for the funcs that have conditions in them :)

You got your tests. Had to fix some of the things that were wrong with the code under test, too!

@malcolmholmes malcolmholmes merged commit 0306001 into master Aug 27, 2021
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