Skip to content

Commit

Permalink
update error message + return type
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeedward2000 committed Feb 19, 2025
1 parent a0170f1 commit aa360af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/provider/azure_loadbalancer_backendpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ func newBackendPoolTypePodIP(c *Cloud) BackendPool {
}

func (bpi *backendPoolTypePodIP) CleanupVMSetFromBackendPoolByCondition(_ context.Context, _ *armnetwork.LoadBalancer, _ *v1.Service, _ []*v1.Node, _ string, _ func(string) bool) (*armnetwork.LoadBalancer, error) {
return nil, errors.New("CleanupVMSetFromBackendPoolByCondition is not applicable for pod IP backend pool")
return nil, nil
}

func (bpi *backendPoolTypePodIP) EnsureHostsInPool(_ context.Context, _ *v1.Service, _ []*v1.Node, _ string, _ string, _ string, _ string, _ *armnetwork.BackendAddressPool) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/azure_loadbalancer_backendpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ func TestReconcileBackendPoolsPodIP(t *testing.T) {
bpi := newBackendPoolTypePodIP(az)

t.Run("should return error when getBackendPoolNameForCLBService fails", func(t *testing.T) {
expectedErr := errors.New("dual-stack service is not supported for container load balancer")
expectedErr := errors.New("dual-stack services are not supported when LB backend pool type is PodIP")
service := getTestServiceDualStack("svc-1", v1.ProtocolTCP, nil, 80)

_, _, _, err := bpi.ReconcileBackendPools(context.TODO(), "", &service, &armnetwork.LoadBalancer{})
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/azure_local_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ func isDualStackService(service *v1.Service) bool {

func (az *Cloud) getBackendPoolNameForCLBService(service *v1.Service) (string, error) {
if isDualStackService(service) {
return "", fmt.Errorf("dual-stack service is not supported for container load balancer")
return "", fmt.Errorf("dual-stack services are not supported when LB backend pool type is PodIP")
}

switch service.Spec.IPFamilies[0] {
Expand Down

0 comments on commit aa360af

Please sign in to comment.