Cause: The logic used to group nested descriptors on the operand details pages did not account for hidden descriptors at the top level.
Consequence: Object-type details items that had a hidden descriptor defined would sometimes be rendered as empty objects on the operand details page.
Fix: Update the operand details page grouping logic to omit hidden object properties.
Result: Object properties with a hidden descriptor are no longer rendered on the operand details page.
Created attachment 1788212[details]
Check the below portion of the ScreenShot
Description of problem:
An object(struct)'s nested field with 'hidden' descriptor in it's CSV should hide it in the operator instance creation form on the OpenShift Console.
But when the instance is created without any value to that, it is still visible in the detail page of the instance as a blank field.
How reproducible:
Always.
Steps to Reproduce:
1. Create an Operator through Operator-SDK with the following changes in the api's property file -
~~~
type myObject struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="myObject",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"}
// +optional
MyString string `json:"storage,omitempty"`
}
--
--
// MemcachedSpec defines the desired state of Memcached
type MemcachedSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Size int32 `json:"size"`
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="JRS",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"}
// +optional
Obj myObject `json:"myObj"`
}
~~~
2. Deploy the operator on OpenShift.
3. Change the csv to have -
~~~
specDescriptors:
- displayName: JRS
path: Obj
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: myObject
path: Obj.MyString
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
~~~
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2021:2438
Created attachment 1788212 [details] Check the below portion of the ScreenShot Description of problem: An object(struct)'s nested field with 'hidden' descriptor in it's CSV should hide it in the operator instance creation form on the OpenShift Console. But when the instance is created without any value to that, it is still visible in the detail page of the instance as a blank field. How reproducible: Always. Steps to Reproduce: 1. Create an Operator through Operator-SDK with the following changes in the api's property file - ~~~ type myObject struct { // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="myObject",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"} // +optional MyString string `json:"storage,omitempty"` } -- -- // MemcachedSpec defines the desired state of Memcached type MemcachedSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "make" to regenerate code after modifying this file Size int32 `json:"size"` // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="JRS",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"} // +optional Obj myObject `json:"myObj"` } ~~~ 2. Deploy the operator on OpenShift. 3. Change the csv to have - ~~~ specDescriptors: - displayName: JRS path: Obj x-descriptors: - urn:alm:descriptor:com.tectonic.ui:hidden - displayName: myObject path: Obj.MyString x-descriptors: - urn:alm:descriptor:com.tectonic.ui:hidden ~~~