console
console copied to clipboard
Unable to set default values for operand resource requirements
Hi OpenShift Console team,
We would like to fill in the default values for resource requirements in the CRD.
Here's the example of the schema definition:
type OperandSpec struct {
//+operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:resourceRequirements"},order=100
//+kubebuilder:default={limits: {cpu: "500m", memory: "1Gi"}, requests: {cpu: "100m", memory: "256Mi"}}
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
}
When the custom resource is created with kubectl
, the default values are populated successfully. However, when I try to create the same operand using the openshift console, the default values are not shown in the UI. This can be confusing to the user.
After some debugging, it seems that the root cause is related to the issue in the rjsf library (rjsf-team/react-jsonschema-form#2593).
When OpenAPI3 schema contains default additionalResources
, they are not properly displayed and submitted in the form.
OpenShift version: 4.10.3 Kubernetes version: v1.23.3+e419edf Channel: stable-4.10
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
/cc @TheRealJon /kind bug
/remove-lifecycle stale
I haven't tried an example of providing default values for a ResourceRequirement field yet, but this is something that would be helpful for me as well.