Skip to content

Commit

Permalink
Merge pull request #64463 from nicksardo/automated-cherry-pick-of-#64…
Browse files Browse the repository at this point in the history
…349-upstream-release-1.10

Automatic merge from submit-queue.

Automated cherry pick of #64349: Fix nodeport repair for ESIPP services

Cherry pick of #64349 on release-1.10.

#64349: Fix nodeport repair for ESIPP services
  • Loading branch information
Kubernetes Submit Queue authored May 30, 2018
2 parents 4d9a60b + 4c3a6dd commit ae68c6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pkg/registry/core/service/portallocator/controller/repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,10 @@ func collectServiceNodePorts(service *api.Service) []int {
servicePorts = append(servicePorts, int(servicePort.NodePort))
}
}

if service.Spec.HealthCheckNodePort != 0 {
servicePorts = append(servicePorts, int(service.Spec.HealthCheckNodePort))
}

return servicePorts
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ func TestRepairWithExisting(t *testing.T) {
Ports: []api.ServicePort{{NodePort: 111}},
},
},
&api.Service{
ObjectMeta: metav1.ObjectMeta{Namespace: "six", Name: "six"},
Spec: api.ServiceSpec{
HealthCheckNodePort: 144,
},
},
)

registry := &mockRangeRegistry{
Expand All @@ -183,10 +189,10 @@ func TestRepairWithExisting(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if !after.Has(111) || !after.Has(122) || !after.Has(133) {
if !after.Has(111) || !after.Has(122) || !after.Has(133) || !after.Has(144) {
t.Errorf("unexpected portallocator state: %#v", after)
}
if free := after.Free(); free != 98 {
if free := after.Free(); free != 97 {
t.Errorf("unexpected portallocator state: %d free", free)
}
}

0 comments on commit ae68c6f

Please sign in to comment.