Skip to content

Commit 4fbc35c

Browse files
committed
some changes for review comments
1 parent e6b5f0b commit 4fbc35c

File tree

1 file changed

+3
-4
lines changed
  • internal/cmd/ske/kubeconfig/login

1 file changed

+3
-4
lines changed

internal/cmd/ske/kubeconfig/login/login.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919

2020
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
2121
"github.com/stackitcloud/stackit-cli/internal/pkg/auth"
22-
"github.com/stackitcloud/stackit-cli/internal/pkg/config"
2322
"github.com/stackitcloud/stackit-cli/internal/pkg/examples"
2423
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
2524
"github.com/stackitcloud/stackit-cli/internal/pkg/services/ske/client"
@@ -157,12 +156,12 @@ func parseClusterConfig(p *print.Printer, cmd *cobra.Command) (*clusterConfig, e
157156
return nil, fmt.Errorf("unmarshal: %w", err)
158157
}
159158

160-
profile, err := config.GetProfile()
159+
authEmail, err := auth.GetAuthEmail()
161160
if err != nil {
162-
return nil, fmt.Errorf("error getting profile: %w", err)
161+
return nil, fmt.Errorf("error getting auth email: %w", err)
163162
}
164163

165-
clusterConfig.cacheKey = fmt.Sprintf("ske-login-%x", sha256.Sum256([]byte(execCredential.Spec.Cluster.Server+auth.GetProfileEmail(profile))))
164+
clusterConfig.cacheKey = fmt.Sprintf("ske-login-%x", sha256.Sum256([]byte(execCredential.Spec.Cluster.Server+"\x00"+authEmail)))
166165

167166
// NOTE: Fallback if region is not set in the kubeconfig (this was the case in the past)
168167
if clusterConfig.Region == "" {

0 commit comments

Comments
 (0)