console icon indicating copy to clipboard operation
console copied to clipboard

Optional podCount spec descriptor fails if path not present in CR

Open ebaron opened this issue 3 years ago • 1 comments
trafficstars

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.

Screenshot 2022-05-02 at 15-24-21 Red Hat OpenShift Container Platform

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.

ebaron avatar May 02 '22 19:05 ebaron

/cc @TheRealJon

spadgett avatar Jul 25 '22 18:07 spadgett

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

openshift-bot avatar Oct 24 '22 01:10 openshift-bot

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

openshift-bot avatar Nov 23 '22 08:11 openshift-bot