Skip to content

Commit a3795dd

Browse files
Update kubectl-plugin/pkg/cmd/get/get_token.go
Co-authored-by: Han-Ju Chen (Future-Outlier) <eric901201@gmail.com> Signed-off-by: Rueian <rueiancsie@gmail.com>
1 parent 25e438a commit a3795dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kubectl-plugin/pkg/cmd/get/get_token.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/ray-project/kuberay/kubectl-plugin/pkg/util/client"
1313
"github.com/ray-project/kuberay/kubectl-plugin/pkg/util/completion"
1414
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1"
15+
"github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"
1516
)
1617

1718
type GetTokenOptions struct {
@@ -80,7 +81,7 @@ func (options *GetTokenOptions) Run(ctx context.Context, k8sClient client.Client
8081
if err != nil {
8182
return fmt.Errorf("failed to get secret %s/%s: %w", options.namespace, options.cluster, err)
8283
}
83-
if token, ok := secret.Data["auth_token"]; ok {
84+
if token, ok := secret.Data[utils.RAY_AUTH_TOKEN_SECRET_KEY]; ok {
8485
_, err = fmt.Fprint(options.ioStreams.Out, string(token))
8586
} else {
8687
err = fmt.Errorf("secret %s/%s does not have an auth_token", options.namespace, options.cluster)

0 commit comments

Comments
 (0)