-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine all initializer commands with && to catch any failing commands #453
base: main
Are you sure you want to change the base?
Conversation
24e2177
to
a054bf7
Compare
@frittentheke, thank you for the PR! It seems like you have opened 2 PRs for the same issue? Could you please leave only one? Quickly skimming the code, the change seems reasonable on the first glance, but I need to look up the details there again. Additionally, this change requires testing. I'll be able to fully review this in a couple of weeks approx. Hope that's alright! |
I changed one to draft and shall remove the "fixes" reference to this issue. It is simply not "just" a bugfix. Thanks for looking into and testing #453 |
@frittentheke, sorry for the delay! I've finally managed to test this PR a bit. So there are 2 parts:
|
Hi @frittentheke, would you be able to modify the PR to leave only the first change, in |
@yorugac sorry for the delay ... Regarding 1) I created a new PR with just the var typo fixed: #465 As for 2) : I'd like to argue that the current flow actually only handles certain types of errors - those that go into that very output file To me any unexpected non-zero return code should be handled as an error (I know about grafana/k6#2804, #75, ...). A while back I started a bigger PR (#450) completely reworking the way the initializer works through the various tasks and then sends off it's verdict via termination log, the kubernetes-native way of handling this phase (https://kubernetes.io/docs/tasks/debug/debug-application/determine-reason-pod-failure/). But that PR / discussion is for another day I suppose. If you even like the idea to rework the whole thing to make it a lot more robust. |
By running two commands instead of one (the second being the cat | grep), any failures (non-zero exit code) of the first part (containing `k6 inspect`) will be lost and masked away. By chaining them all with `&&` the first non-zero RC will fail the whole command and return. Fixes: grafana#435
a054bf7
to
8008a90
Compare
Hi @frittentheke, apologies for this delay! I've got swamped with internal work. And thank you for your patience! 😂 You described this case:
AFAIR, when imports are off, there should be logs left in initializer which then should cause an error in k6-operator on JSON unmarshal. It sounds like it wasn't so for you, so no logs despite the import error? If so, could you please share a script how to repeat that situation? |
By running two commands instead of one (the second being the cat | grep), any failures (non-zero exit code) of the first part (containing
k6 inspect
) will be lost and masked away.By chaining them all with
&&
the first non-zero RC will fail the whole command and return.Fixes: #435