-
Notifications
You must be signed in to change notification settings - Fork 9
Adapt 'gsctl create kubeconfig' to add support for v5 clusters #437
Conversation
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 good with this in general. One note about v5 vs. v4 logic, but if necessary, that could be also addressed in separate PR. Either way.
apiEndpoint = fmt.Sprintf("https://%s.%s", tenantInternalAPIPrefix, strings.Join(baseEndpoint, urlDelimiter)) | ||
} else { | ||
apiEndpoint = clusterDetailsResponse.Payload.APIEndpoint | ||
if result.apiEndpoint == "" { |
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.
Would it make sense to extract this to separate function and inline the call in if-case above? I find this logic a little difficult to follow, because first it works with V5, then if that fails it potentially just logs and next step is suddenly v4 call if some variable is unset so far.
I feel like these generated types require some wrapping so that the higher level business logic would be clean, but is a bit overkill at this point maybe.
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.
Changed the way cluster details are pulled.
Towards https://github.com/giantswarm/giantswarm/issues/6447, https://github.com/giantswarm/giantswarm/issues/5465
This PR changes the behaviour if the
gsctl create kubeconfig
command-v
/--verbose
flag is applied, to make the output cleaner.Preview