Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Jan 25, 2024
1 parent bcaa0f8 commit 157c04c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion pkg/utils/auth/multitenancy.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ func (mc *MultitenancyConfig) CreateSecretForOIDC(uid string, sk string) error {
Name: uid,
Namespace: ServicesNamespace,
},
Immutable: new(bool),
StringData: map[string]string{
"oidc_uid": uid,
"accessKey": uid,
Expand Down
5 changes: 3 additions & 2 deletions pkg/utils/auth/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package auth

import (
"context"
"fmt"
"log"
"os"

Expand Down Expand Up @@ -114,11 +115,11 @@ func getOIDCMiddleware(kubeClientset *kubernetes.Clientset, minIOAdminClient *ut
// Create MinIO user and k8s secret with credentials
err = mc.CreateSecretForOIDC(uid, sk)
if err != nil {
oidcLogger.Println("Error creating secret for user: ", uid)
c.String(http.StatusInternalServerError, fmt.Sprintf("Error creating secret for user %s: %v", uid, err))
}
err = minIOAdminClient.CreateMinIOUser(uid, sk)
if err != nil {
oidcLogger.Println("Error creating MinIO user: ", uid)
c.String(http.StatusInternalServerError, fmt.Sprintf("Error creating MinIO user for uid %s: %v", uid, err))
}
}
oidcLogger.Printf("User %s already exists", uid)
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/minio.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (minIOAdminClient *MinIOAdminClient) CreateMinIOUser(ak string, sk string)
return fmt.Errorf("error creating MinIO user: %v", err)
}

users[0] = ak
users = append(users, ak)
err2 := minIOAdminClient.AddUserToGroup(users, ALL_USERS_GROUP)
if err2 != nil {
return err2
Expand Down

0 comments on commit 157c04c

Please sign in to comment.