improve: deprecate instance based Mappers.fromOwnerReferences#3365
Open
csviri wants to merge 1 commit into
Open
improve: deprecate instance based Mappers.fromOwnerReferences#3365csviri wants to merge 1 commit into
csviri wants to merge 1 commit into
Conversation
This does not make sense to me, this should be always based on class Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR deprecates the instance-based Mappers.fromOwnerReferences(HasMetadata ...) overloads in favor of using class-based (or explicit apiVersion/kind) inputs, aligning mapper creation with static primary resource types.
Changes:
- Mark
fromOwnerReferences(HasMetadata)as deprecated for removal. - Mark
fromOwnerReferences(HasMetadata, boolean)as deprecated for removal.
Comments suppressed due to low confidence (1)
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/Mappers.java:101
- Same here: the deprecation annotation doesn’t indicate the intended replacement. Please add a Javadoc
@deprecatedmessage (and optionally an inline@link) so consumers know to switch to the class-based overload.
@Deprecated(forRemoval = true)
public static <T extends HasMetadata> SecondaryToPrimaryMapper<T> fromOwnerReferences(
HasMetadata primaryResource, boolean clusterScoped) {
return fromOwnerReferences(
primaryResource.getApiVersion(), primaryResource.getKind(), clusterScoped);
}
Comment on lines
89
to
95
|
|
||
| @Deprecated(forRemoval = true) | ||
| public static <T extends HasMetadata> SecondaryToPrimaryMapper<T> fromOwnerReferences( | ||
| HasMetadata primaryResource) { | ||
| return fromOwnerReferences(primaryResource, false); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
TBH, I also think that all deprecations should point to replacements or explain why the method is being dropped.
xstefank
approved these changes
May 20, 2026
Comment on lines
89
to
95
|
|
||
| @Deprecated(forRemoval = true) | ||
| public static <T extends HasMetadata> SecondaryToPrimaryMapper<T> fromOwnerReferences( | ||
| HasMetadata primaryResource) { | ||
| return fromOwnerReferences(primaryResource, false); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
TBH, I also think that all deprecations should point to replacements or explain why the method is being dropped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This does not make sense to me, this should be always based on class
Signed-off-by: Attila Mészáros a_meszaros@apple.com