mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Document broken behaviour with KUBE_API_VERSIONS
This commit is contained in:
parent
543417dbf0
commit
e57ef4327f
@ -25,6 +25,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -246,8 +247,16 @@ func Run(s *options.ServerRunOptions) error {
|
|||||||
}
|
}
|
||||||
client, err := internalclientset.NewForConfig(selfClientConfig)
|
client, err := internalclientset.NewForConfig(selfClientConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
kubeAPIVersions := os.Getenv("KUBE_API_VERSIONS")
|
||||||
|
if len(kubeAPIVersions) == 0 {
|
||||||
return fmt.Errorf("failed to create clientset: %v", err)
|
return fmt.Errorf("failed to create clientset: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KUBE_API_VERSIONS is used in test-update-storage-objects.sh, disabling a number of API
|
||||||
|
// groups. This leads to a nil client above and undefined behaviour further down.
|
||||||
|
// TODO: get rid of KUBE_API_VERSIONS or define sane behaviour if set
|
||||||
|
glog.Errorf("Failed to create clientset with KUBE_API_VERSIONS=%q. KUBE_API_VERSIONS is only for testing. Things will break.", kubeAPIVersions)
|
||||||
|
}
|
||||||
sharedInformers := informers.NewSharedInformerFactory(nil, client, 10*time.Minute)
|
sharedInformers := informers.NewSharedInformerFactory(nil, client, 10*time.Minute)
|
||||||
|
|
||||||
authorizationConfig := s.Authorization.ToAuthorizationConfig(sharedInformers)
|
authorizationConfig := s.Authorization.ToAuthorizationConfig(sharedInformers)
|
||||||
|
Loading…
Reference in New Issue
Block a user