console
console copied to clipboard
Optional podCount spec descriptor fails if path not present in CR
Hi! My CRD includes the following structure:
spec:
reportOptions:
replicas: 0
Both reportOptions and replicas are optional fields. The replicas field uses the podCount spec descriptor. If the user creates an instance of this CRD without specifying reportOptions.replicas, and then attempts to modify the field using the form view, an error is returned and no change occurs to the CR.

This error appears to be caused by this 422 Unprocessable Entity,
14:59:22.223 XHRPATCHhttps://console-openshift-console.apps.cryostat.example.com/api/kubernetes/apis/operator.cryostat.io/v1beta1/namespaces/cryostat-test/cryostats/cryostat-sample
[HTTP/1.1 422 Unprocessable Entity 50ms]
0
op "replace"
path "/spec/reportOptions/replicas"
value 1
I'm guessing this is due to attempting a replace operation on a field that's not present. Perhaps this could check if the value is not present and do an add operation instead.
/cc @TheRealJon
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle rotten /remove-lifecycle stale