-
Notifications
You must be signed in to change notification settings - Fork 65
Conversation
b2bad19
to
5da7346
Compare
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.
minor feedback.
I'm not sure what the use case for this is @fabriziopandini can you expand on your TODO a little bit more here? Maybe open an issue if it's significant enough?
apiServerEndpoint := config.Spec.JoinConfiguration.Discovery.BootstrapToken.APIServerEndpoint | ||
needValidateAPIEndpoints := true |
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 could do away with this boolean and always validate, right? I think the optimization of running this validation code is not worth introducing the boolean and we should validate every time regardless.
} | ||
// validate user provided APIServerEndpoint matches the api endpoint defined at cluster level | ||
if needValidateAPIEndpoints { | ||
found := 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.
I'd put this whole thing in a function,
func validateAPIEndpoints(endpoint string, endpoints []string) error {
...
}
5da7346
to
1041da9
Compare
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.
Thank you for your explanation @fabriziopandini |
1041da9
to
6154335
Compare
That's fine with me. Approving and lgtm as this is only comment changes. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chuckha, SataQiu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Add APIServerEndpoint validation for JoinConfiguration
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #