Skip to content

Commit eafd20f

Browse files
committed
rename error reason to AddedOrUpdatedWithError
Signed-off-by: Haywood Shannon <[email protected]> Signed-off-by: Haywood Shannon <[email protected]>
1 parent dfc030e commit eafd20f

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

docs/content/configuration/global-configuration/globalconfiguration-resource.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Events:
148148
Type Reason Age From Message
149149
---- ------ ---- ---- -------
150150
Normal Updated 55s nginx-ingress-controller GlobalConfiguration nginx-ingress/nginx-configuration was updated
151-
Warning WithError 6s nginx-ingress-controller GlobalConfiguration nginx-ingress/nginx-configuration is invalid and was rejected: spec.listeners: Duplicate value: "Duplicated port/protocol combination 53/UDP"
151+
Warning AddedOrUpdatedWithError 6s nginx-ingress-controller GlobalConfiguration nginx-ingress/nginx-configuration is invalid and was rejected: spec.listeners: Duplicate value: "Duplicated port/protocol combination 53/UDP"
152152
```
153153

154-
Note how the events section includes a Warning event with the WithError reason.
154+
Note how the events section includes a Warning event with the AddedOrUpdatedWithError reason.

internal/k8s/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ func (lbc *LoadBalancerController) syncGlobalConfiguration(task task) {
15661566
eventMessage := fmt.Sprintf("GlobalConfiguration %s was added or updated", key)
15671567

15681568
if validationErr != nil {
1569-
eventTitle = "WithError"
1569+
eventTitle = "AddedOrUpdatedWithError"
15701570
eventType = api_v1.EventTypeWarning
15711571
eventMessage = fmt.Sprintf("GlobalConfiguration %s is updated with errors: %v", key, validationErr)
15721572
}

tests/suite/test_transport_server_status.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def test_status_warning(
7979
transport_server_setup.name,
8080
)
8181
self.restore_ts(kube_apis, transport_server_setup)
82-
print(response)
8382
assert (
8483
response["status"]
8584
and response["status"]["reason"] == "Rejected"
@@ -152,12 +151,11 @@ def test_valid_status_invalid_udp_listener(self, kube_apis, crd_ingress_controll
152151
gc_event_latest = gc_events[-1]
153152
print(gc_event_latest)
154153
assert (
155-
gc_event_latest.reason == "WithError"
154+
gc_event_latest.reason == "AddedOrUpdatedWithError"
156155
and gc_event_latest.type == "Warning"
157156
and "GlobalConfiguration nginx-ingress/nginx-configuration is updated with errors: "
158157
"spec.listeners[0].port: Forbidden: Listener dns-udp: port 9113 is forbidden" in gc_event_latest.message
159158
)
160-
wait_before_test()
161159

162160
def test_valid_status_invalid_tcp_listener(self, kube_apis, crd_ingress_controller, transport_server_setup):
163161
"""
@@ -191,9 +189,8 @@ def test_valid_status_invalid_tcp_listener(self, kube_apis, crd_ingress_controll
191189
gc_event_latest = gc_events[-1]
192190
print(gc_event_latest)
193191
assert (
194-
gc_event_latest.reason == "WithError"
192+
gc_event_latest.reason == "AddedOrUpdatedWithError"
195193
and gc_event_latest.type == "Warning"
196194
and "GlobalConfiguration nginx-ingress/nginx-configuration is updated with errors: "
197195
"spec.listeners[1].port: Forbidden: Listener dns-tcp: port 9113 is forbidden" in gc_event_latest.message
198196
)
199-
wait_before_test()

tests/suite/test_virtual_server_custom_listeners.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def test_custom_listeners(
283283
print(gc_event_latest)
284284
if test_setup["expected_gc_error_msg"]:
285285
assert (
286-
gc_event_latest.reason == "WithError"
286+
gc_event_latest.reason == "AddedOrUpdatedWithError"
287287
and gc_event_latest.type == "Warning"
288288
and test_setup["expected_gc_error_msg"] in gc_event_latest.message
289289
)
@@ -385,7 +385,6 @@ def test_custom_listeners_update(
385385
global_config_file = f"{TEST_DATA}/virtual-server-custom-listeners/global-configuration.yaml"
386386
gc_resource = create_gc_from_yaml(kube_apis.custom_objects, global_config_file, "nginx-ingress")
387387
vs_custom_listeners = f"{TEST_DATA}/virtual-server-custom-listeners/virtual-server.yaml"
388-
wait_before_test()
389388

390389
print("\nStep 2: Create VS with custom listener (http-8085, https-8445)")
391390
patch_virtual_server_from_yaml(
@@ -477,7 +476,7 @@ def test_custom_listeners_update(
477476
print(gc_event_latest)
478477
if test_setup["expected_gc_error_msg"]:
479478
assert (
480-
gc_event_latest.reason == "WithError"
479+
gc_event_latest.reason == "AddedOrUpdatedWithError"
481480
and gc_event_latest.type == "Warning"
482481
and test_setup["expected_gc_error_msg"] in gc_event_latest.message
483482
)

0 commit comments

Comments
 (0)