-
Notifications
You must be signed in to change notification settings - Fork 114
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
use openshift_context instead of internal function in util package #409
use openshift_context instead of internal function in util package #409
Conversation
Thanks for your PR,
To skip the vendors CIs use one of:
|
as requested by @bn222 I create a new PR to always use the ocp context |
Pull Request Test Coverage Report for Build 4233514086
💛 - Coveralls |
Thanks for your PR,
To skip the vendors CIs use one of:
|
pkg/utils/openshift_context.go
Outdated
} | ||
|
||
openshiftFlavor := OpenshiftFlavorDefault | ||
if ClusterType == ClusterTypeOpenshift { |
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.
Maybe I miss something but if the first conditional in this function checks for ClusterType != ClusterTypeOpenshift
, how can this ever be false?
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.
you are right I change 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.
I don't see the change
logger.Error(err, "Fail to get control plane topology") | ||
return err | ||
} | ||
external := r.OpenshiftContext.IsHypershift() |
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.
I suspect this can cause panic:
https://go.dev/play/p/hDtR5cPY6Lj?v=goprev
Maybe it's better to change IsHypershift()
's receiver from OpenshiftContext
to *OpenshiftContext
and add a nil check inside that function.
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.
I'm not in favor of passing around pointers just to check for nil. Instead, I think we should pass around the context still, and have it explicitly say it is not Openshift.
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.
good catch!
I update to first check if we are running on ocp
6508291
to
53f5a6d
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
53f5a6d
to
aed354f
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
/lgtm |
aed354f
to
030ac59
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
Signed-off-by: Sebastian Sch <[email protected]>
before this change my IDE was complaining that the function is not right ``` Cannot use 'f' (type func()) as the type DialFunc ``` Signed-off-by: Sebastian Sch <[email protected]>
030ac59
to
095dc66
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
/lgtm |
No description provided.