Closed jpugliesi closed 5 years ago
Thanks for the suggestion. I will add the nil
check. Although as you pointed out, the sensor should have the correct node with a nodeId
. I was testing v0.8.5-test with username
and password
and it works as expected.
Describe the bug The
controllers/sensor
package'sMarkNodePhase
function does not validate that a returnednode
pointer variable is not null before accessing the pointer's fieldsIn the case outlined below in To Reproduce, this results in the following runtime error (segmentation violation):
To Reproduce Steps to reproduce the behavior:
argoproj/sensor:v0.8.5-test
, and agit
trigger source referencing a private repository:Expected behavior First off, I don't have enough context to understand why the
sensor.Stats.Nodes
map withinGetNodeByName
would not contain anodeId
.Still,
MarkNodePhase
should check if the value returned byGetNodeByName
is null before accessing values, and somehow gracefully handle the case where it is in fact null. I'm not sure what an appropriate solution would be, but perhaps the fix would have the following structure:Additional context This error does not occur when running the same reproduction steps on
v0.8.3
. Regardless, it seems important to handle the case where a node can't be found by name (possibly by validating thenode
pointer is notnull
before accessing its fields.)