fix minor compilation error for group claim

us 'os' insteak of 'io/ioutil'

Signed-off-by: Rui Yang <ruiya@vmware.com>
This commit is contained in:
Rui Yang 2021-11-17 17:42:55 -05:00
parent 7c80e44caf
commit 8b865169bd

View File

@ -8,9 +8,9 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"io/ioutil"
"net" "net"
"net/http" "net/http"
"os"
"strings" "strings"
"time" "time"
@ -122,7 +122,7 @@ func newHTTPClient(rootCAs []string, insecureSkipVerify bool) (*http.Client, err
tlsConfig := tls.Config{RootCAs: pool, InsecureSkipVerify: insecureSkipVerify} tlsConfig := tls.Config{RootCAs: pool, InsecureSkipVerify: insecureSkipVerify}
for _, rootCA := range rootCAs { for _, rootCA := range rootCAs {
rootCABytes, err := ioutil.ReadFile(rootCA) rootCABytes, err := os.ReadFile(rootCA)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to read root-ca: %v", err) return nil, fmt.Errorf("failed to read root-ca: %v", err)
} }
@ -249,7 +249,7 @@ func (c *oauthConnector) addGroupsFromMap(groups map[string]struct{}, result map
} }
if groupMap, ok := group.(map[string]interface{}); ok { if groupMap, ok := group.(map[string]interface{}); ok {
if groupName, ok := groupMap["name"].(string); ok { if groupName, ok := groupMap["name"].(string); ok {
groups[groupName] = true groups[groupName] = struct{}{}
} }
} }
} }