Skip to content

Commit c38353a

Browse files
committed
Update Ingress status
1 parent f8fc99c commit c38353a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

internal/k8s/status.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type statusUpdater struct {
3535
bigIPAddress string
3636
bigIPPorts string
3737
externalEndpoints []conf_v1.ExternalEndpoint
38-
status []api_v1.LoadBalancerIngress
38+
status []networking.IngressLoadBalancerIngress
3939
statusInitialized bool
4040
keyFunc func(obj interface{}) (string, error)
4141
namespacedInformers map[string]*namespacedInformer
@@ -96,7 +96,7 @@ func (su *statusUpdater) UpdateExternalEndpointsForResource(r Resource) error {
9696

9797
// ClearIngressStatus clears the Ingress status.
9898
func (su *statusUpdater) ClearIngressStatus(ing networking.Ingress) error {
99-
return su.updateIngressWithStatus(ing, []api_v1.LoadBalancerIngress{})
99+
return su.updateIngressWithStatus(ing, []networking.IngressLoadBalancerIngress{})
100100
}
101101

102102
// UpdateIngressStatus updates the status on the selected Ingress.
@@ -126,7 +126,7 @@ func (su *statusUpdater) getNamespacedInformer(ns string) *namespacedInformer {
126126
}
127127

128128
// updateIngressWithStatus sets the provided status on the selected Ingress.
129-
func (su *statusUpdater) updateIngressWithStatus(ing networking.Ingress, status []api_v1.LoadBalancerIngress) error {
129+
func (su *statusUpdater) updateIngressWithStatus(ing networking.Ingress, status []networking.IngressLoadBalancerIngress) error {
130130
// Get an up-to-date Ingress from the Store
131131
key, err := su.keyFunc(&ing)
132132
if err != nil {
@@ -212,12 +212,12 @@ func (su *statusUpdater) retryStatusUpdate(clientIngress typednetworking.Ingress
212212
// saveStatus saves the string array of IPs or addresses that we will set as status
213213
// on all the Ingresses that we manage.
214214
func (su *statusUpdater) saveStatus(ips []string) {
215-
statusIngs := []api_v1.LoadBalancerIngress{}
215+
statusIngs := []networking.IngressLoadBalancerIngress{}
216216
for _, ip := range ips {
217217
if net.ParseIP(ip) == nil {
218-
statusIngs = append(statusIngs, api_v1.LoadBalancerIngress{Hostname: ip})
218+
statusIngs = append(statusIngs, networking.IngressLoadBalancerIngress{Hostname: ip})
219219
} else {
220-
statusIngs = append(statusIngs, api_v1.LoadBalancerIngress{IP: ip})
220+
statusIngs = append(statusIngs, networking.IngressLoadBalancerIngress{IP: ip})
221221
}
222222
}
223223
su.status = statusIngs
@@ -664,7 +664,7 @@ func (su *statusUpdater) updateVirtualServerRouteExternalEndpoints(vsr *conf_v1.
664664
return err
665665
}
666666

667-
func (su *statusUpdater) generateExternalEndpointsFromStatus(status []api_v1.LoadBalancerIngress) []conf_v1.ExternalEndpoint {
667+
func (su *statusUpdater) generateExternalEndpointsFromStatus(status []networking.IngressLoadBalancerIngress) []conf_v1.ExternalEndpoint {
668668
var externalEndpoints []conf_v1.ExternalEndpoint
669669
for _, lb := range status {
670670
ports := su.externalServicePorts

internal/k8s/status_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ func TestStatusUpdateWithExternalStatusAndExternalService(t *testing.T) {
193193
Namespace: "namespace",
194194
},
195195
Status: networking.IngressStatus{
196-
LoadBalancer: v1.LoadBalancerStatus{
197-
Ingress: []v1.LoadBalancerIngress{
196+
LoadBalancer: networking.IngressLoadBalancerStatus{
197+
Ingress: []networking.IngressLoadBalancerIngress{
198198
{
199199
IP: "1.2.3.4",
200200
},
@@ -299,8 +299,8 @@ func TestStatusUpdateWithExternalStatusAndIngressLink(t *testing.T) {
299299
Namespace: "namespace",
300300
},
301301
Status: networking.IngressStatus{
302-
LoadBalancer: v1.LoadBalancerStatus{
303-
Ingress: []v1.LoadBalancerIngress{
302+
LoadBalancer: networking.IngressLoadBalancerStatus{
303+
Ingress: []networking.IngressLoadBalancerIngress{
304304
{
305305
IP: "1.2.3.4",
306306
},
@@ -409,7 +409,7 @@ func TestGenerateExternalEndpointsFromStatus(t *testing.T) {
409409
}{
410410
{
411411
su: statusUpdater{
412-
status: []v1.LoadBalancerIngress{
412+
status: []networking.IngressLoadBalancerIngress{
413413
{
414414
IP: "8.8.8.8",
415415
},
@@ -421,7 +421,7 @@ func TestGenerateExternalEndpointsFromStatus(t *testing.T) {
421421
},
422422
{
423423
su: statusUpdater{
424-
status: []v1.LoadBalancerIngress{
424+
status: []networking.IngressLoadBalancerIngress{
425425
{
426426
Hostname: "my-loadbalancer.example.com",
427427
},

0 commit comments

Comments
 (0)