Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/ccm/stackit.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ func init() {
return nil, errors.New("region must be set")
}

if cfg.LoadBalancer.API == "" {
cfg.LoadBalancer.API = "https://load-balancer.api.eu01.stackit.cloud"
}
if cfg.LoadBalancer.NetworkID == "" {
return nil, errors.New("networkId must be set")
}
Expand Down Expand Up @@ -129,10 +126,13 @@ func BuildObservability() (*MetricsRemoteWrite, error) {
// NewCloudControllerManager creates a new instance of the stackit struct from a config struct
func NewCloudControllerManager(cfg *Config, obs *MetricsRemoteWrite) (*CloudControllerManager, error) {
lbOpts := []sdkconfig.ConfigurationOption{
sdkconfig.WithEndpoint(cfg.LoadBalancer.API),
sdkconfig.WithHTTPClient(metrics.NewInstrumentedHTTPClient()),
}

if cfg.LoadBalancer.API != "" {
lbOpts = append(lbOpts, sdkconfig.WithEndpoint(cfg.LoadBalancer.API))
}

// The token is only provided by the 'gardener-extension-provider-stackit' in case of emergency access.
// In those cases, the [cfg.LoadBalancerAPI.URL] will also be different (direct API URL instead of the API Gateway)
lbEmergencyAPIToken := os.Getenv(stackitLoadBalancerEmergencyAPIToken)
Expand Down