Problem Description
When using OpenShifts.adminBinary().execute() to delete a non-existent resource, the method returns null instead of the actual error message from the oc command.
Expected Behavior
When executing oc delete kafkatopic abc on a non-existent resource manually, the command outputs an error message such as:
Error from server (NotFound): kafkatopics.kafka.strimzi.io "abc" not found
Actual Behavior
When the same command is executed via XTF's OpenShifts.adminBinary(namespace).execute("delete", "kafkatopic", "abc"), the method returns null instead of the error message.
Reproduction
Test Code:
@Test
public void testDeleteNonExistentKafkaTopic() {
LOG.info("Attempting to delete non-existent Kafka topic: {}", TOPIC_NAME);
String result = OpenShifts.adminBinary(NAMESPACE).execute("delete", "kafkatopic", TOPIC_NAME);
LOG.info("Delete command result: {}", result); // Logs: "Delete command result: null"
}
Manual execution:
$ oc delete kafkatopic abc
Error from server (NotFound): kafkatopics.kafka.strimzi.io "abc" not found
Impact
This makes it difficult to properly handle error cases in tests, as there's no way to distinguish between:
- Successful deletion (returns null)
- Resource not found (returns null)
- Other errors (returns null)
Expected Fix
The BinaryClient.execute() method should return the error output from stderr when the command fails, similar to how manual oc command execution works.
Problem Description
When using
OpenShifts.adminBinary().execute()to delete a non-existent resource, the method returnsnullinstead of the actual error message from theoccommand.Expected Behavior
When executing
oc delete kafkatopic abcon a non-existent resource manually, the command outputs an error message such as:Actual Behavior
When the same command is executed via XTF's
OpenShifts.adminBinary(namespace).execute("delete", "kafkatopic", "abc"), the method returnsnullinstead of the error message.Reproduction
Test Code:
Manual execution:
$ oc delete kafkatopic abc Error from server (NotFound): kafkatopics.kafka.strimzi.io "abc" not foundImpact
This makes it difficult to properly handle error cases in tests, as there's no way to distinguish between:
Expected Fix
The
BinaryClient.execute()method should return the error output from stderr when the command fails, similar to how manualoccommand execution works.