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

Decouple logic to detect OpenShift from OpenShift Routes. #1338 #1421

Closed
wants to merge 11 commits into from

Conversation

iblancasa
Copy link
Contributor

@iblancasa iblancasa commented Feb 1, 2023

Signed-off-by: Israel Blancas [email protected]

Fixes #1418

@iblancasa iblancasa requested a review from a team February 1, 2023 16:08
@iblancasa
Copy link
Contributor Author

/cc @frzifus

@iblancasa iblancasa marked this pull request as draft February 1, 2023 17:33
Signed-off-by: Israel Blancas <[email protected]>
@iblancasa iblancasa marked this pull request as ready for review February 1, 2023 17:50
controllers/opentelemetrycollector_controller.go Outdated Show resolved Hide resolved
controllers/opentelemetrycollector_controller.go Outdated Show resolved Hide resolved
controllers/opentelemetrycollector_controller.go Outdated Show resolved Hide resolved
controllers/opentelemetrycollector_controller.go Outdated Show resolved Hide resolved
Signed-off-by: Israel Blancas <[email protected]>
Signed-off-by: Israel Blancas <[email protected]>
pkg/openshift-routes/main.go Outdated Show resolved Hide resolved
pkg/openshift-routes/main.go Outdated Show resolved Hide resolved
Signed-off-by: Israel Blancas <[email protected]>
Signed-off-by: Israel Blancas <[email protected]>
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix
Copy link
Member

Choose a reason for hiding this comment

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

Is this a user-facing bug fix or fix of the e2e test?

I would prefer to skip changelog for fixing tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is not a test fix.
I cataloged it as bug fix because installing the OpenShift Routes in a Kubernetes cluster, will make the operator think it is an OpenShift server.

controllers/opentelemetrycollector_controller.go Outdated Show resolved Hide resolved
internal/config/main.go Outdated Show resolved Hide resolved
pkg/openshift-routes/main.go Outdated Show resolved Hide resolved
package openshift_routes

// Platform holds the auto-detected platform type.
type OpenShiftRoutesAvailability int
Copy link
Member

Choose a reason for hiding this comment

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

I don't get the purpose of this package. Is it just to define the constants?

Copy link
Member

Choose a reason for hiding this comment

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

Alright this package seems to be inspired by the platform package. I would propose to merge the platform package with the autodetect. The consumer of platform needs to import autodetect as well, I don't see a reason why these packages need to be split.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I followed @frzifus directions from #1338.

I'll merge it

Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@frzifus What I wanted to say: as @pavolloffay, I followed the implementation platform. Following your directions during our conversation talking about #1338.


const (
// Is not clear if OpenShift Routes are available.
Unknown OpenShiftRoutesAvailability = iota
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need both Unknown and NotAvailable states?

If possible I would define only Available and NotAvailable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Followed the approach suggested by @frzifus. Copied from the platform approach

Copy link
Member

Choose a reason for hiding this comment

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

From my point of view it make sense to provide an unknown state too. Even it its the same as NotAvailable it provides the information that until then, the detection didnt run.

pkg/autodetect/main.go Outdated Show resolved Hide resolved
@iblancasa iblancasa requested review from pavolloffay and frzifus and removed request for pavolloffay and frzifus February 6, 2023 10:57
@iblancasa iblancasa requested review from pavolloffay and removed request for frzifus February 6, 2023 10:58
@iblancasa iblancasa requested review from pavolloffay and frzifus and removed request for pavolloffay and frzifus February 6, 2023 17:30
@iblancasa iblancasa closed this Feb 7, 2023
@iblancasa iblancasa deleted the bug/1418 branch February 9, 2023 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants