Skip to content

fix: generate proper resource name & finalizer for group-less resources #814

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

Merged
merged 3 commits into from
Jan 12, 2022

Conversation

metacosm
Copy link
Collaborator

Fixes #812

@metacosm metacosm added this to the v2 milestone Jan 11, 2022
@metacosm metacosm self-assigned this Jan 11, 2022
@metacosm metacosm requested a review from csviri January 11, 2022 21:28
return getResourceTypeName(getResourceClass());
}

static <T extends HasMetadata> String getResourceTypeName(Class<T> resourceClass) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, pls add unit test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a workaround for a fix that will be in fabric8 5.12 where it's already pretty well tested.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, that is kinda questionable, still our code, maybe we can copy the unit test too?

Copy link
Collaborator

Choose a reason for hiding this comment

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

But if too much effort, I'm ok to skip it.


public static String getDefaultFinalizerName(String crdName) {
return crdName + FINALIZER_NAME_SUFFIX;
public static String getDefaultFinalizerName(String resourceName) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pls add unit test

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

73.3% 73.3% Coverage
0.0% 0.0% Duplication

@metacosm metacosm merged commit fdefd56 into main Jan 12, 2022
@metacosm metacosm deleted the fix-812 branch January 12, 2022 15:34
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.

Resource names are not currently properly generated
2 participants