First, change the the openshift-multus namespace
oc project openshift-multus
Go ahead and make a modified cronjob that's based on the existing one
This edits the yaml and adds a line for a -timeout
flag.
oc get cronjob ip-reconciler -o yaml | grep -vP "creationTimestamp|\- apiVersion|ownerReferences|blockOwnerDeletion|controller|kind\: Network|name\: cluster|uid\:|resourceVersion" | sed 's/name: ip-reconciler/name: test-reconciler/' | sed '/ - -log-level=verbose/a \ \ \ \ \ \ \ \ \ \ \ \ - -timeout=invalid' > /tmp/reconcile.yml
Then create this additional cronjob from the generated file
oc create -f /tmp/reconcile.yml
Now, kick off an instance of this cronjob
oc create job --from=cronjob/test-reconciler -n openshift-multus testrun-ip-reconciler
Now list the testrun job
oc get pods | grep testrun
This pod should be erroring out and the error message should look like:
$ oc get pods | grep testrun
testrun-ip-reconciler-28mfg 0/1 Error 0 13s
$ oc logs testrun-ip-reconciler-28mfg
invalid value "invalid" for flag -timeout: parse error
Usage of /ip-reconciler:
-kubeconfig string
the path to the Kubernetes configuration file
-log-level ip-reconciler
the logging level for the ip-reconciler app. Valid values are: "debug", "verbose", "error", and "panic". (default "error")
-timeout int
the value for a request timeout in seconds. (default 30)
We want to see the error in this case. This lets us know that it's read the flag that we're looking for.