Skip to content

Commit 9c261f7

Browse files
committed
Allow supervisor hostname override
1 parent b5af081 commit 9c261f7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • pkg/cloudprovider/vsphereparavirtual/config

pkg/cloudprovider/vsphereparavirtual/config/config.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ const (
4949
SupervisorServiceAccountNameEnv string = "SUPERVISOR_CLUSTER_SERVICEACCOUNT_SECRET_NAME"
5050
// SupervisorAPIServerFQDN reads supervisor service API server's fully qualified domain name from env
5151
SupervisorAPIServerFQDN string = "supervisor.default.svc"
52+
// InternalSupervisorHostnameOverrideEnv allows overriding the default supervisor hostname
53+
InternalSupervisorHostnameOverrideEnv string = "INTERNAL_SUPERVISOR_HOSTNAME_OVERRIDE"
5254
)
5355

5456
// SupervisorEndpoint is the supervisor cluster endpoint
@@ -131,8 +133,14 @@ func GetRestConfig(svConfigPath string) (*rest.Config, error) {
131133
return nil, err
132134
}
133135

136+
supervisorHostname := SupervisorAPIServerFQDN
137+
if override := os.Getenv(InternalSupervisorHostnameOverrideEnv); override != "" {
138+
klog.V(4).Infof("Using supervisor hostname override: %s", override)
139+
supervisorHostname = override
140+
}
141+
134142
return &rest.Config{
135-
Host: "https://" + net.JoinHostPort(SupervisorAPIServerFQDN, svEndpoint.Port),
143+
Host: "https://" + net.JoinHostPort(supervisorHostname, svEndpoint.Port),
136144
TLSClientConfig: rest.TLSClientConfig{
137145
CAData: rootCA,
138146
},

0 commit comments

Comments
 (0)