addon-operator
addon-operator copied to clipboard
ModuleRun tasks can be queued while global hooks are run
A global hook can change module section in configmap/addon-operator and this leads to run an enabled script. It is OK when all global onStartup and kubernetes.Synchronization hooks are already run and it is terrible if enabled script depends on several global hook results (think of discovery).
One of possible solutions is to disable handling changes in module sections until the first DiscoverModuleState task is finished.
{
"binding": "onStartup",
"event.type": "OperatorStartup",
"hook": "migrate_xx_to_yy",
"hook.type": "global",
"level": "info",
"msg": "Global hook run",
"operator.component": "taskRunner",
"queue": "main",
"task.id": "11c3ad01-0784-461f-b223-5efb8500248d"
}
{
"binding": "onStartup",
"event.type": "OperatorStartup",
"hook": "migrate_xx_to_yy",
"hook.type": "global",
"level": "info",
"msg": "configmap/addon-operator replaced",
"output": "stdout",
"queue": "main",
"task.id": "11c3ad01-0784-461f-b223-5efb8500248d"
}
{
"level": "info",
"msg": "KUBE_CONFIG Detect module sections changes: 1 updated, 0 removed"
}
{
"level": "warning",
"msg": "ignore module section for unknown module 'cloud-instance-manager':\nModule(Name=cloud-instance-manager IsEnabled=<nil> IsUpdated=false Values:\ncloudInstanceManager:\n instancePrefix: kube\n)",
"operator.component": "HandleConfigMap"
}
{
"level": "info",
"module": "priority-class",
"msg": "version null does not match the semver scheme 'X.Y.Z(-PRERELEASE)(+BUILD)'. See help for more information.",
"operator.component": "HandleConfigMap",
"output": "stderr"
}
{
"level": "info",
"module": "priority-class",
"msg": "/shell_lib/enabled.sh: line 16: [: : integer expression expected",
"operator.component": "HandleConfigMap",
"output": "stderr"
}
{
"level": "info",
"module": "priority-class",
"msg": "Enabled script run successful, result: module \"Enabled\"",
"operator.component": "HandleConfigMap"
}
...