Skip to content

Commit

Permalink
Fixed secret name error
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Jan 26, 2024
1 parent 157c04c commit 7dfbe5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/utils/auth/multitenancy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"crypto/rand"
"encoding/base64"
"regexp"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -87,9 +88,13 @@ func (mc *MultitenancyConfig) CheckUsersInCache(uids []string) []string {

func (mc *MultitenancyConfig) CreateSecretForOIDC(uid string, sk string) error {

uidr, _ := regexp.Compile("[0-9a-z]+@")
idx := uidr.FindStringIndex(uid)
secret_name := uid[0 : idx[1]-1]

secret := &v1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: uid,
Name: secret_name,
Namespace: ServicesNamespace,
},
StringData: map[string]string{
Expand Down

0 comments on commit 7dfbe5d

Please sign in to comment.