bouskaJ commented on issue #1076: Support KUBECONF env variable
URL: https://github.com/apache/camel-k/pull/1076#issuecomment-557564001
 
 
   I can't agree. Let's see following functions read my comments:
   
   ```
   func shouldUseContainerMode() (bool, error) {
        // When kube config is set, container mode is not used
        if os.Getenv(k8sutil.KubeConfigEnvVar) != "" {
                return false, nil                             --- My case - 
return false
        }
   
   func initialize(kubeconfig string) {
        if kubeconfig == "" { 
                // skip out-of-cluster initialization if inside the container
                if kc, err := shouldUseContainerMode(); kc && err == nil {      
 --- kc == false -> continue
                        return
                } else if err != nil {
                        logrus.Errorf("could not determine if running in a 
container: %v", err)
                }
                var err error
                kubeconfig, err = getDefaultKubeConfigFile()      --- Load 
kubernetes config from HOME dir (not from KUBECONF)
                if err != nil {
                        panic(err)
                }
        }
        os.Setenv(k8sutil.KubeConfigEnvVar, kubeconfig)           --- Override 
my KUBECONF property
   }
   ```
   
   Source:
   
https://github.com/apache/camel-k/blob/21eb85be58b3bb8807180bc24892c17adb7b12df/pkg/client/client.go#L204-L208
   https://github.com/apache/camel-k/blob/master/pkg/client/client.go#L136-L150

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to