Skip to content

Commit

Permalink
fix refactored functin name
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Dettori <[email protected]>
  • Loading branch information
pdettori committed May 28, 2024
1 parent 7fd27e7 commit b6ce0ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/kflex/ctx/ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (c *CPCtx) Context(chattyStatus, failIfNone bool) {
ctxName := certs.GenerateContextName(c.Name)
util.PrintStatus(fmt.Sprintf("Switching to context %s...", ctxName), done, &wg, chattyStatus)
if err = kubeconfig.SwitchContext(kconf, c.Name); err != nil {
fmt.Fprintf(os.Stderr, "kubeconfig context %s not found, trying to load from server...\n", err)
fmt.Fprintf(os.Stderr, "kubeconfig context %s not found, trying to load from server...\n", c.Name)
if err := c.switchToHostingClusterContextAndWrite(kconf); err != nil {
fmt.Fprintf(os.Stderr, "Error switching back to hosting cluster context: %s\n", err)
os.Exit(1)
Expand Down Expand Up @@ -126,7 +126,7 @@ func (c *CPCtx) loadAndMergeFromServer(kconfig *api.Config) error {

// for control plane of type host just switch to initial context
if cp.Spec.Type == tenancyv1alpha1.ControlPlaneTypeHost {
return kubeconfig.SwitchToInitialContext(kconfig, false)
return kubeconfig.SwitchToHostingClusterContext(kconfig, false)
}

// for all other control planes need to get secret with off-cluster kubeconfig
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubeconfig/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func LoadAndMerge(ctx context.Context, client kubernetes.Clientset, name, contro
return err
}
} else {
err = SwitchToInitialContext(konfig, false)
err = SwitchToHostingClusterContext(konfig, false)
if err != nil {
return err
}
Expand Down

0 comments on commit b6ce0ca

Please sign in to comment.