Skip to content

Commit b53d5c7

Browse files
Remove default overwrite of LoadBalancer API endpoint (#521)
Co-authored-by: Maximilian Geberl <maximilian.geberl@stackit.cloud>
1 parent ea7f418 commit b53d5c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/ccm/stackit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ func init() {
6363
return nil, errors.New("region must be set")
6464
}
6565

66-
if cfg.LoadBalancer.API == "" {
67-
cfg.LoadBalancer.API = "https://load-balancer.api.eu01.stackit.cloud"
68-
}
6966
if cfg.LoadBalancer.NetworkID == "" {
7067
return nil, errors.New("networkId must be set")
7168
}
@@ -130,10 +127,13 @@ func BuildObservability() (*MetricsRemoteWrite, error) {
130127
// NewCloudControllerManager creates a new instance of the stackit struct from a config struct
131128
func NewCloudControllerManager(cfg *Config, obs *MetricsRemoteWrite) (*CloudControllerManager, error) {
132129
lbOpts := []sdkconfig.ConfigurationOption{
133-
sdkconfig.WithEndpoint(cfg.LoadBalancer.API),
134130
sdkconfig.WithHTTPClient(metrics.NewInstrumentedHTTPClient()),
135131
}
136132

133+
if cfg.LoadBalancer.API != "" {
134+
lbOpts = append(lbOpts, sdkconfig.WithEndpoint(cfg.LoadBalancer.API))
135+
}
136+
137137
// The token is only provided by the 'gardener-extension-provider-stackit' in case of emergency access.
138138
// In those cases, the [cfg.LoadBalancerAPI.URL] will also be different (direct API URL instead of the API Gateway)
139139
lbEmergencyAPIToken := os.Getenv(stackitLoadBalancerEmergencyAPIToken)

0 commit comments

Comments
 (0)