Add logs to inform when nodes are tainted

Add logs to inform when the 'services=disabled:NoExecute' taint is added
to nodes as well as when they are removed.

This aims to improve future log analysis by facilitating the
identification of cases where taints could be mistakenly added to nodes.

Test Plan:
PASS: lock controller and check if the operation is properly logged
PASS: unlock controller and check if the operation is properly logged

Partial-Bug: 2022008
Change-Id: Ie9c7432211621a9fbf7aa90282dfb91405f90c33
Signed-off-by: Igor Soares <igor.piressoares@windriver.com>
This commit is contained in:
Igor Soares 2023-05-31 15:54:19 -03:00 committed by Igor Soares
parent a4280ebf59
commit 0ece2f8e0e
1 changed files with 10 additions and 2 deletions

View File

@ -2394,7 +2394,11 @@ class NFVIInfrastructureAPI(nfvi.api.v1.NFVIInfrastructureAPI):
host_name, "NoExecute", "services")
future.result = (yield)
if not future.result.is_complete():
if future.result.is_complete():
DLOG.info("Taint services=disabled:NoExecute successfully "
"removed from host, host_uuid=%s, host_name=%s."
% (host_uuid, host_name))
else:
DLOG.error("Kubernetes untaint_node failed, operation "
"did not complete, host_uuid=%s, host_name=%s."
% (host_uuid, host_name))
@ -2437,7 +2441,11 @@ class NFVIInfrastructureAPI(nfvi.api.v1.NFVIInfrastructureAPI):
future.result = (yield)
if not future.result.is_complete():
if future.result.is_complete():
DLOG.info("Taint services=disabled:NoExecute successfully "
"added to host, host_uuid=%s, host_name=%s."
% (host_uuid, host_name))
else:
DLOG.error("Kubernetes taint_node failed, operation "
"did not complete, host_uuid=%s, host_name=%s."
% (host_uuid, host_name))