Skip to content

Commit 3460536

Browse files
committed
fix: Small fixes/refactors based on PR feedback
1 parent af947e8 commit 3460536

4 files changed

Lines changed: 5 additions & 26 deletions

File tree

pkg/controller/selfhostedshootexposure/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (a *Actuator) DetermineOptions(ctx context.Context, exposure *extensionsv1a
7777
}
7878
a.Client.Scheme().Default(providerConfig)
7979

80-
if errs := validation.ValidateSelfHostedShootExposureConfig(providerConfig, field.NewPath("spec.providerConfig")); len(errs) > 0 {
80+
if errs := validation.ValidateSelfHostedShootExposureConfig(providerConfig, field.NewPath("spec", "providerConfig")); len(errs) > 0 {
8181
return nil, fmt.Errorf("invalid providerConfig: %w", errs.ToAggregate())
8282
}
8383

pkg/controller/selfhostedshootexposure/resources_loadbalancer.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ func (r *Resources) reconcileLoadBalancer(ctx context.Context, log logr.Logger)
4747
if !r.loadBalancerNeedsUpdate(targets) {
4848
return nil
4949
}
50-
// STACKIT's UpdateLoadBalancer is a single PUT covering all managed fields (targets, plan,
51-
// ACL). UpdateLoadBalancerTargetPool would also work for target-only changes, but it returns
52-
// only the TargetPool — we'd still need a follow-up GET to refresh r.LoadBalancer for the
53-
// readiness check, so it costs an extra round-trip without a server-side latency win
54-
// (STACKIT transitions the LB to PENDING on either write).
50+
// STACKIT also exposes a partial target-pool update endpoint, but it returns only the
51+
// TargetPool — we'd still need a follow-up GET to refresh r.LoadBalancer for the readiness
52+
// check, so it costs an extra round-trip without a server-side latency win (STACKIT
53+
// transitions the LB to PENDING on either write). Use the full PUT instead.
5554
return r.updateLoadBalancer(ctx, log, targets)
5655
}
5756

pkg/stackit/client/loadbalancing.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ type LoadBalancingClient interface {
1717
GetLoadBalancer(ctx context.Context, name string) (*loadbalancer.LoadBalancer, error)
1818
ListLoadBalancers(ctx context.Context) ([]loadbalancer.LoadBalancer, error)
1919
UpdateLoadBalancer(ctx context.Context, name string, payload loadbalancer.UpdateLoadBalancerPayload) (*loadbalancer.LoadBalancer, error)
20-
UpdateLoadBalancerTargetPool(ctx context.Context, name, targetPool string, payload loadbalancer.UpdateTargetPoolPayload) (*loadbalancer.TargetPool, error)
2120
DeleteLoadBalancer(ctx context.Context, name string) error
2221
}
2322

@@ -69,10 +68,6 @@ func (l loadBalancingClient) UpdateLoadBalancer(ctx context.Context, name string
6968
return l.Client.UpdateLoadBalancer(ctx, l.projectID, l.region, name).UpdateLoadBalancerPayload(payload).Execute()
7069
}
7170

72-
func (l loadBalancingClient) UpdateLoadBalancerTargetPool(ctx context.Context, name, targetPool string, payload loadbalancer.UpdateTargetPoolPayload) (*loadbalancer.TargetPool, error) {
73-
return l.Client.UpdateTargetPool(ctx, l.projectID, l.region, name, targetPool).UpdateTargetPoolPayload(payload).Execute()
74-
}
75-
7671
func (l loadBalancingClient) DeleteLoadBalancer(ctx context.Context, name string) error {
7772
_, err := l.Client.DeleteLoadBalancer(ctx, l.projectID, l.region, name).Execute()
7873
return err

pkg/stackit/client/mock/loadbalancing_mock.go

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)