mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +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/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@ -246,7 +247,15 @@ func Run(s *options.ServerRunOptions) error {
|
||||
}
|
||||
client, err := internalclientset.NewForConfig(selfClientConfig)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create clientset: %v", err)
|
||||
kubeAPIVersions := os.Getenv("KUBE_API_VERSIONS")
|
||||
if len(kubeAPIVersions) == 0 {
|
||||
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user