-
Notifications
You must be signed in to change notification settings - Fork 236
improve: naming on ResourceID API #3151
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,17 +62,9 @@ public boolean equals(Object o) { | |
| return Objects.equals(name, that.name) && Objects.equals(namespace, that.namespace); | ||
| } | ||
|
|
||
| public boolean isSameResource(HasMetadata hasMetadata) { | ||
| if (hasMetadata == null) { | ||
| return false; | ||
| } | ||
| final var metadata = hasMetadata.getMetadata(); | ||
| return isSameResource(metadata.getName(), metadata.getNamespace()); | ||
| } | ||
|
|
||
| /** | ||
| * Whether this ResourceID points to the same resource as the one identified by the specified name | ||
| * and namespace. | ||
| * Whether this ResourceID points to the same resource as the one identified only by the specified | ||
| * name and namespace. | ||
| * | ||
| * <p>Note that this doesn't take API version or Kind into account so this should only be used | ||
| * when checking resources that are reasonably expected to be of the same type. | ||
|
|
@@ -83,7 +75,7 @@ public boolean isSameResource(HasMetadata hasMetadata) { | |
| * specified name and namespace, {@code false} otherwise | ||
| * @since 5.3.0 | ||
| */ | ||
| public boolean isSameResource(String name, String namespace) { | ||
| public boolean equals(String name, String namespace) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I though overloaded would be too much an issue, but you might be right that naming wise this could raise some eyebrows. |
||
| return Objects.equals(this.name, name) && Objects.equals(this.namespace, namespace); | ||
| } | ||
|
|
||
|
|
||
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.
This would technically be an API break.
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.
That is true, so not sure to how extent we consider this as an internal API, but since users use this with customt
SecondaryToPrimaryMapperit might be an issue.