check_o2ims_provisioning_request(name, namespace) in operators/o2ims-operator/controllers/utils.py never uses name:
r = requests.get(
f"{KUBERNETES_BASE_URL}/apis/o2ims.provisioning.oran.org/v1alpha1/provisioningrequests",
...
)
That is the collection endpoint. The API server answers it with a ProvisioningRequestList, but the helper then reads r.json()["status"]["provisioningStatus"] as though it were a single object. ProvisioningRequest is cluster-scoped, so namespace correctly does not appear, but a single object should be fetched from:
/apis/o2ims.provisioning.oran.org/v1alpha1/provisioningrequests/{name}
There is a second mismatch on the 404 branch. The helper stores a bool:
response.update({"pv": creation_status["status"]})
while manager.py reads it as a mapping:
Both survive today because the unit tests register a single object at the collection URL, which is not how the API server behaves, so the mocks conceal the bug rather than exposing it. Fixing this means correcting the URL, agreeing one response shape between helper and caller, and changing the tests to mock a List at the collection URL and an object at the object URL.
Found while reviewing #1170, which changes credential handling on the same call path but not this logic.
check_o2ims_provisioning_request(name, namespace)inoperators/o2ims-operator/controllers/utils.pynever usesname:That is the collection endpoint. The API server answers it with a
ProvisioningRequestList, but the helper then readsr.json()["status"]["provisioningStatus"]as though it were a single object.ProvisioningRequestis cluster-scoped, sonamespacecorrectly does not appear, but a single object should be fetched from:There is a second mismatch on the 404 branch. The helper stores a bool:
while
manager.pyreads it as a mapping:Both survive today because the unit tests register a single object at the collection URL, which is not how the API server behaves, so the mocks conceal the bug rather than exposing it. Fixing this means correcting the URL, agreeing one response shape between helper and caller, and changing the tests to mock a
Listat the collection URL and an object at the object URL.Found while reviewing #1170, which changes credential handling on the same call path but not this logic.