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

feat: decouple from ObjectMapper #1953

Merged
merged 4 commits into from
Jun 20, 2023
Merged

feat: decouple from ObjectMapper #1953

merged 4 commits into from
Jun 20, 2023

Conversation

metacosm
Copy link
Collaborator

next

@metacosm metacosm self-assigned this Jun 20, 2023
@metacosm metacosm requested a review from csviri June 20, 2023 08:43
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 20, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2023
@metacosm metacosm changed the base branch from main to next June 20, 2023 08:43
}


ObjectMapper mapper = new ObjectMapper();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do I understand correctly that this mapper will be adapted? We will create an instance even if the user provides one I guess.

}


ObjectMapper mapper = new ObjectMapper();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe rename it to "DEFAUL_OBJECT_MAPPER", this effectively static.


// override the configuration service to use the same client
if (overrider != null) {
overrider = overrider.andThen(o -> o.withKubernetesClient(this.kubernetesClient));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be good to have unit/integration tests for these setting parts. Also shouldn't we deprecate the client as param if it is also in ConfigurationService?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't understand your last point. Regarding unit tests, this is far from finished. I'm not going to move forward with this unless we agree on the approach to take first.

Copy link
Collaborator

Choose a reason for hiding this comment

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

sure, np, just a remark

@metacosm metacosm force-pushed the fix-object-mapper branch from 71aca8d to f26c41d Compare June 20, 2023 13:15
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2023
@metacosm metacosm marked this pull request as ready for review June 20, 2023 13:16
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 20, 2023
@openshift-ci openshift-ci bot requested review from adam-sandor and andreaTP June 20, 2023 13:16
@metacosm metacosm force-pushed the fix-object-mapper branch from f26c41d to 2a28cc2 Compare June 20, 2023 13:17
Copy link
Collaborator

@csviri csviri left a comment

Choose a reason for hiding this comment

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

Added a small comment otherwise LGTM

@@ -261,6 +253,11 @@ static ConfigurationService newOverriddenConfigurationService(
return baseConfiguration;
}

static ConfigurationService newOverriddenConfigurationService(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This feels little smelly, since in an abstraction we creating an overrode of specific implementation, is this really needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not really, just noticing that the overriding method is almost always called passing it a new BaseConfigurationService instance. Also, I think it makes it easier for users because they might not know which instance to use to override the defaults. Open to cleaning this up further.

@metacosm metacosm merged commit ffca5e2 into next Jun 20, 2023
@metacosm metacosm deleted the fix-object-mapper branch June 20, 2023 18:49
csviri pushed a commit that referenced this pull request Jun 21, 2023
* refactor: use unmarshal instead of adding new method, works with 6.7.2

* feat: provide and use Kubernetes client directly
metacosm added a commit that referenced this pull request Jun 23, 2023
* refactor: use unmarshal instead of adding new method, works with 6.7.2

* feat: provide and use Kubernetes client directly
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.

3 participants