Skip to content

Commit

Permalink
panic when get auth cm failed
Browse files Browse the repository at this point in the history
  • Loading branch information
weilaaa committed Sep 11, 2023
1 parent 5120418 commit 85aef2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/apiserver/cubeapi/authorization/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ func NewHandler() *handler {
nn := types.NamespacedName{Name: constants.AuthMappingCM, Namespace: env.CubeNamespace()}
err := h.Client.Direct().Get(context.Background(), nn, &cm)
if err != nil {
clog.Warn("get auth item configmap %v failed: %v", nn, err)
clog.Fatal("get auth item configmap %v failed: %v", nn, err)
}

platformCm := corev1.ConfigMap{}
nn1 := types.NamespacedName{Name: constants.AuthPlatformMappingCM, Namespace: env.CubeNamespace()}
err = h.Client.Direct().Get(context.Background(), nn1, &platformCm)
if err != nil {
clog.Warn("get platform auth item configmap %v failed: %v", nn1, err)
clog.Fatal("get platform auth item configmap %v failed: %v", nn1, err)
}

h.cmData = cm.Data
Expand Down

0 comments on commit 85aef2b

Please sign in to comment.