Merge pull request #14888 from zetaab/fixingresstatus

Fix ingress status for loadbalancers that does not have publicname
This commit is contained in:
Kubernetes Prow Robot 2022-12-27 11:01:28 -08:00 committed by GitHub
commit 4b66b5b72c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 19 deletions

View File

@ -717,11 +717,14 @@ func getApiIngressStatus(c OpenstackCloud, cluster *kops.Cluster) ([]fi.ApiIngre
func getLoadBalancerIngressStatus(c OpenstackCloud, cluster *kops.Cluster) ([]fi.ApiIngressStatus, error) {
var ingresses []fi.ApiIngressStatus
lbName := "api." + cluster.Name
if cluster.Spec.API.PublicName != "" {
lbName = cluster.Spec.API.PublicName
}
// Note that this must match OpenstackModel lb name
klog.V(2).Infof("Querying Openstack to find Loadbalancers for API (%q)", cluster.Name)
lbList, err := c.ListLBs(loadbalancers.ListOpts{
Name: cluster.Spec.API.PublicName,
Name: lbName,
})
if err != nil {
return ingresses, fmt.Errorf("GetApiIngressStatus: Failed to list openstack loadbalancers: %v", err)
@ -742,7 +745,7 @@ func getLoadBalancerIngressStatus(c OpenstackCloud, cluster *kops.Cluster) ([]fi
}
}
}
}
return ingresses, nil
}