@hongming 感谢您的回复
尝试过修改 mappingMethod 改为 auto,但是依旧会报错,界面提示Not Found
,查看ks-apiserver
ks-apiserver 的日志,具体错误如下:
E1221 09:20:38.660326 1 login_recoder.go:71] LoginRecord.iam.kubesphere.io "system:pre-registration-hf8jt" is invalid: [metadata.generateName: Invalid value: "system:pre-registration-": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.name: Invalid value: "system:pre-registration-hf8jt": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.labels: Invalid value: "system:pre-registration": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')]
E1221 09:20:38.660360 1 handler.go:198] Failed to record successful login for user system:pre-registration, error: LoginRecord.iam.kubesphere.io "system:pre-registration-hf8jt" is invalid: [metadata.generateName: Invalid value: "system:pre-registration-": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.name: Invalid value: "system:pre-registration-hf8jt": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.labels: Invalid value: "system:pre-registration": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')]
2020/12/21 09:20:39 http: panic serving 10.233.70.99:42678: assignment to entry in nil map
goroutine 2342 [running]:
net/http.(*conn).serve.func1(0xc000e66c80)
/opt/hostedtoolcache/go/1.13.15/x64/src/net/http/server.go:1795 +0x139
panic(0x2d6b7e0, 0x38941e0)
/opt/hostedtoolcache/go/1.13.15/x64/src/runtime/panic.go:679 +0x1b2
kubesphere.io/kubesphere/pkg/apiserver/auditing.(*auditing).LogRequestObject(0xc000b92d20, 0xc000c6d000, 0xc000da8930, 0x2b15c20)
/home/runner/work/kubesphere/kubesphere/pkg/apiserver/auditing/types.go:187 +0x89a
kubesphere.io/kubesphere/pkg/apiserver/filters.WithAuditing.func1(0x393b1a0, 0xc002be7880, 0xc000c6d000)
/home/runner/work/kubesphere/kubesphere/pkg/apiserver/filters/auditing.go:51 +0x100
net/http.HandlerFunc.ServeHTTP(0xc000b92d50, 0x393b1a0, 0xc002be7880, 0xc000c6d000)
/opt/hostedtoolcache/go/1.13.15/x64/src/net/http/server.go:2036 +0x44
kubesphere.io/kubesphere/pkg/apiserver/filters.WithAuthorization.func1(0x393b1a0, 0xc002be7880, 0xc000c6d000)
/home/runner/work/kubesphere/kubesphere/pkg/apiserver/filters/authorization.go:50 +0x37c
net/http.HandlerFunc.ServeHTTP(0xc000d2ea00, 0x393b1a0, 0xc002be7880, 0xc000c6d000)
/opt/hostedtoolcache/go/1.13.15/x64/src/net/http/server.go:2036 +0x44
kubesphere.io/kubesphere/pkg/apiserver/filters.WithMultipleClusterDispatcher.func1(0x393b1a0, 0xc002be7880, 0xc000c6d000)
/home/runner/work/kubesphere/kubesphere/pkg/apiserver/filters/dispatch.go:43 +0xd9
net/http.HandlerFunc.ServeHTTP(0xc000b93620, 0x393b1a0, 0xc002be7880, 0xc000c6d000)
/opt/hostedtoolcache/go/1.13.15/x64/src/net/http/server.go:2036 +0x44
kubesphere.io/kubesphere/pkg/apiserver/filters.WithAuthentication.func1(0x393b1a0, 0xc002be7880, 0xc000c6d000)
/home/runner/work/kubesphere/kubesphere/pkg/apiserver/filters/authentication.go:68 +0x5ce
net/http.HandlerFunc.ServeHTTP(0xc000d2eb40, 0x393b1a0, 0xc002be7880, 0xc000c6cf00)
/opt/hostedtoolcache/go/1.13.15/x64/src/net/http/server.go:2036 +0x44
kubesphere.io/kubesphere/pkg/apiserver/filters.WithRequestInfo.func1(0x393b1a0, 0xc002be7880, 0xc000c6ce00)
/home/runner/work/kubesphere/kubesphere/pkg/apiserver/filters/requestinfo.go:67 +0x3c5
net/http.HandlerFunc.ServeHTTP(0xc000b93dd0, 0x393b1a0, 0xc002be7880, 0xc000c6ce00)
/opt/hostedtoolcache/go/1.13.15/x64/src/net/http/server.go:2036 +0x44
net/http.serverHandler.ServeHTTP(0xc0001aa540, 0x393b1a0, 0xc002be7880, 0xc000c6ce00)
/opt/hostedtoolcache/go/1.13.15/x64/src/net/http/server.go:2831 +0xa4
net/http.(*conn).serve(0xc000e66c80, 0x394da20, 0xc001a67280)
/opt/hostedtoolcache/go/1.13.15/x64/src/net/http/server.go:1919 +0x875
created by net/http.(*Server).Serve
/opt/hostedtoolcache/go/1.13.15/x64/src/net/http/server.go:2957 +0x384
看错误提示,应该是创建用户时 system:pre-registration 出错,GitHubIdentityProvider 是默认支持插件,应该是已经 适配好的,不用再有其他额外的设置吧?!