-
Notifications
You must be signed in to change notification settings - Fork 54
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
Removes GVKRequired struct #400
Merged
tmshort
merged 1 commit into
operator-framework:main
from
m1kola:get_rid_of_extra_struct
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
Why do we have the
type GVK property.GVK
type alias above? Why do we need one of these two aliases but not both?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.
@stevekuznetsov I beleive this is only for use to define
String()
method on it.I see no reason for
GVKRequired
to exist as both are esentially the same struct\schema.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.
Another guess: probably we re-define structs so we don't spread
property.GVK
across controller-runtime codebase.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.
a) if we need aliases here, we need all of them
b) if there's a semantic difference between
GVK
andGVKRequired
, we need to keep that difference herec) if there's not a difference, let's go to
"github.com/operator-framework/operator-registry/alpha/property"
and removeGVKRequired
.What does this mean? Why would we not want to do "spread"? What are the implications?
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.
Ha! I didn't even notice
GVKRequired
was an alias forproperty.GVKRequired
.There is semantic difference between properties (they have different type), but not between structs: they both represent GVK. See:
olm.gvk.required
olm.gvk
Like probably there was an idea to redefine struct in operator controller to have less dependency on operator-registry? I don't know, I'm just guessing what the original author meant 🤷♂️.
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.
If there is a semantic difference, I don't know that we can remove the use of one. Users are expected to understand the implication of each.
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.
We are not removing
olm.gvk.required
property type. User will still be using it. I'm only proposing to re-use a struct into which we unmarshal values of properties of both typesolm.gvk
andolm.gvk.required
.GVKRequired
is being converted intoGVK
anyway.But I agree with you - this should be done on
operator-registry
side first. When creating this PR I didn't notice that thatoperator-registry
also has two different structs for it.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.
Ahh, I see. It looks like the only purpose of separate
GVKRequired
is to enableoperator-registry
to get its type using reflection and map it to a property type.