Ensure orphan public IPs deleted
This commit is contained in:
@@ -858,13 +858,13 @@ func TestReconcilePublicIPWithNewService(t *testing.T) {
|
||||
az := getTestCloud()
|
||||
svc := getTestService("servicea", v1.ProtocolTCP, 80, 443)
|
||||
|
||||
pip, err := az.reconcilePublicIP(testClusterName, &svc, true /* wantLb*/)
|
||||
pip, err := az.reconcilePublicIP(testClusterName, &svc, nil, true /* wantLb*/)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %q", err)
|
||||
}
|
||||
validatePublicIP(t, pip, &svc, true)
|
||||
|
||||
pip2, err := az.reconcilePublicIP(testClusterName, &svc, true /* wantLb */)
|
||||
pip2, err := az.reconcilePublicIP(testClusterName, &svc, nil, true /* wantLb */)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %q", err)
|
||||
}
|
||||
@@ -879,7 +879,7 @@ func TestReconcilePublicIPRemoveService(t *testing.T) {
|
||||
az := getTestCloud()
|
||||
svc := getTestService("servicea", v1.ProtocolTCP, 80, 443)
|
||||
|
||||
pip, err := az.reconcilePublicIP(testClusterName, &svc, true /* wantLb*/)
|
||||
pip, err := az.reconcilePublicIP(testClusterName, &svc, nil, true /* wantLb*/)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %q", err)
|
||||
}
|
||||
@@ -887,7 +887,7 @@ func TestReconcilePublicIPRemoveService(t *testing.T) {
|
||||
validatePublicIP(t, pip, &svc, true)
|
||||
|
||||
// Remove the service
|
||||
pip, err = az.reconcilePublicIP(testClusterName, &svc, false /* wantLb */)
|
||||
pip, err = az.reconcilePublicIP(testClusterName, &svc, nil, false /* wantLb */)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %q", err)
|
||||
}
|
||||
@@ -899,7 +899,7 @@ func TestReconcilePublicIPWithInternalService(t *testing.T) {
|
||||
az := getTestCloud()
|
||||
svc := getInternalTestService("servicea", 80, 443)
|
||||
|
||||
pip, err := az.reconcilePublicIP(testClusterName, &svc, true /* wantLb*/)
|
||||
pip, err := az.reconcilePublicIP(testClusterName, &svc, nil, true /* wantLb*/)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %q", err)
|
||||
}
|
||||
@@ -911,7 +911,7 @@ func TestReconcilePublicIPWithExternalAndInternalSwitch(t *testing.T) {
|
||||
az := getTestCloud()
|
||||
svc := getInternalTestService("servicea", 80, 443)
|
||||
|
||||
pip, err := az.reconcilePublicIP(testClusterName, &svc, true /* wantLb*/)
|
||||
pip, err := az.reconcilePublicIP(testClusterName, &svc, nil, true /* wantLb*/)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %q", err)
|
||||
}
|
||||
@@ -919,14 +919,14 @@ func TestReconcilePublicIPWithExternalAndInternalSwitch(t *testing.T) {
|
||||
|
||||
// Update to external service
|
||||
svcUpdated := getTestService("servicea", v1.ProtocolTCP, 80)
|
||||
pip, err = az.reconcilePublicIP(testClusterName, &svcUpdated, true /* wantLb*/)
|
||||
pip, err = az.reconcilePublicIP(testClusterName, &svcUpdated, nil, true /* wantLb*/)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %q", err)
|
||||
}
|
||||
validatePublicIP(t, pip, &svcUpdated, true)
|
||||
|
||||
// Update to internal service again
|
||||
pip, err = az.reconcilePublicIP(testClusterName, &svc, true /* wantLb*/)
|
||||
pip, err = az.reconcilePublicIP(testClusterName, &svc, nil, true /* wantLb*/)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %q", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user