Skip to content

Commit 865ddd7

Browse files
Kumm-Kairubenhoenle
authored andcommitted
some changes for review comments
1 parent 9c73f9c commit 865ddd7

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
@@ -20,7 +20,6 @@ import (
2020

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

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

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

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

0 commit comments

Comments
 (0)