Closed divyenpatel closed 3 weeks ago
/approve /ok-to-test
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: divyenpatel, gohilankit, shalini-b
The full list of commands accepted by this bot can be found here.
The pull request process is described here
/lgtm
What this PR does / why we need it: This PR is required to support KUBECONFIG env variable for vSphere CSI controller and syncer pod. when KUBECONFIG env variable is supplied but kubeconfig flag is not set, current code is setting default flag value.
This value is set by controller-runtime - https://github.com/kubernetes-sigs/controller-runtime/blame/main/pkg/client/config/config.go#L40-L58
default value set in the kubeconfig flag is over riding env variable supplied in the container. This result into env variable being ignored, and code path is creating kubernetes client using in-cluster config instead of using kubeconfig supplied in environment variable.
Testing done:
Unit test
Verified on the live setup when kubeconfig flag is supplied, below is the log
Verified on the live setup when kubeconfig env variable but flag is not supplied, below is the log
Release note: