Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of what has been changed:
commandResponse[0].parameters
field is missing in case of an error as discussed in this comment Add e2e test for IBM MQ Scaler #1287 (comment) . Reference about the response body format (JSON schema): https://www.ibm.com/docs/en/ibm-mq/9.3?topic=adminactionqmgrqmgrnamemqsc-post-json-formatted-command#q133340___responseformat__title__1For example when querying the current queue depth of a non existing queue:
Example from the operator log with the new error handling:
2024-06-02T16:18:50Z INFO Detected resource targeted for scaling {"controller": "scaledobject", "controllerGroup": "keda.sh", "controllerKind": "ScaledObject", "ScaledObject": {"name":"ibmmq-consumer","namespace":"ibmmq-test-ns"}, "namespace": "ibmmq-test-ns", "name": "ibmmq-consumer", "reconcileID": "c064a17e-7cd1-4a1e-ba90-c3dc8f4b4a6d", "resource": "apps/v1.Deployment", "name": "ibmmq-consumer"} +2024-06-02T16:18:51Z ERROR scale_handler error getting scale decision {"scaledObject.Namespace": "ibmmq-test-ns", "scaledObject.Name": "ibmmq-consumer", "scaler": "IBMMQScaler", "error": "error inspecting IBM MQ queue depth: failed to get the current queue depth parameter, reason: AMQ8147E: IBM MQ object FAKE.QUEUE not found."} github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).getScalerState /workspace/pkg/scaling/scale_handler.go:780 github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).getScaledObjectState.func1 /workspace/pkg/scaling/scale_handler.go:633
Checklist
Fixes #1287