Skip to content

Conversation

@csviri
Copy link
Collaborator

@csviri csviri commented Jan 26, 2026

No description provided.

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
@openshift-ci openshift-ci bot requested review from metacosm and xstefank January 26, 2026 14:38
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 26, 2026
@csviri csviri changed the base branch from main to next January 26, 2026 14:38
@csviri csviri changed the title sample facelift improve: facelift samples to use ReconcileUtils Jan 26, 2026
@csviri csviri marked this pull request as draft January 26, 2026 14:44
@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 Jan 26, 2026
.inNamespace(ns)
.resource(desiredHtmlConfigMap)
.serverSideApply();
ReconcileUtils.serverSideApply(context, desiredHtmlConfigMap);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes me think that maybe we should remove ReconcileUtils altogether and put its method on Context instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ReconcileUtils now contains all kind of other methods, see also PR #3130
So we would need a Reconcile utils anyways.

For adding those methods into Context I have mixed feelings: it would be easier to discover for sure, on the other hand having basically utility methods there does not feel right to me. Also I'm a little bit affraid that would make too much noise/pollute the Context, so would be harder to understand the details of context for the user.
Also, I assume some more such methods might come in the future.

So with design wise I would formulate it like: have minimal stuff exposed absolutely necessary through the Context, and putting everything else, helper methods into the ReconcileUtils.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But up to discussion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@xstefank @shawkins what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It makes sense but from a design-perspective, I'm always suspicious of static functions that all take the same object parameter. It's usually an indication that this function should probably be a method of that object.

Regarding that other PR, it doesn't seem like these new methods are particularly related to reconciliation, which weakens the unity of ReconcileUtils, imo. I mean I get not wanting to create lots of utility classes for discovery purposes but, on the same token, putting too many loosely coupled functions in a single object doesn't help discovery either (and yes, that applies to Context as you correctly pointed out).

Copy link
Collaborator

@xstefank xstefank Jan 27, 2026

Choose a reason for hiding this comment

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

TBH, I can see both points but I'm more inclined to put these methods on context because less visual noise for the user and easier discoverability. I rarely scroll down all available methods of an object. I think most people will read the docs first and understand how to call everything. So to me it's between static method vs the object already in params, and the second case wins.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the thing is that the param in that Reconcile utils is not the primary resource but a resource that user explicitly creates. Let's have a separate issues for this, dicsuss it on community meeting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

let's continue here, will merge this and the other PR, and we can still refactor before the release:
#3136

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 26, 2026
@csviri csviri marked this pull request as ready for review January 26, 2026 15:35
@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 Jan 26, 2026
@openshift-ci openshift-ci bot requested a review from metacosm January 26, 2026 15:35
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
@csviri csviri merged commit f852af5 into operator-framework:next Jan 27, 2026
25 checks passed
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.

4 participants