Bug 1957499

Summary: OperatorHub - console accepts any value for "Infrastructure features" annotation
Product: OpenShift Container Platform Reporter: Bryan Florkiewicz <bflorkie>
Component: Management ConsoleAssignee: Bryan Florkiewicz <bflorkie>
Status: CLOSED ERRATA QA Contact: Xiyun Zhao <xiyuzhao>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.7CC: aos-bugs, jhadvig, jokerman, pkreuser, spadgett, tony.wu, yanpzhan, yapei
Target Milestone: ---   
Target Release: 4.7.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1955803 Environment:
Last Closed: 2021-06-15 09:27:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1955803    
Bug Blocks:    

Description Bryan Florkiewicz 2021-05-05 21:09:40 UTC
+++ This bug was initially created as a clone of Bug #1955803 +++

Description of problem:

Currently, console accepts any value for `operators.openshift.io/infrastructure-features` and shows it in the UI (see attached: 1_bacon-bundle.png).
The console could/should restrict what we allow to a "well-defined" list.

There's been a few changes in the annotations for "Infrastructure features" documented in OCP doc:
https://docs.openshift.com/container-platform/4.7/operators/operator_sdk/osdk-generating-csvs.html#osdk-csv-manual-annotations_osdk-generating-csvs

We want to make sure the console handles both values as in "the latest doc" + "what those were before" as we are about to push Operator fleets to adopt these.

Version-Release number of selected component (if applicable):
OCP 4.8

How reproducible:
100%

Steps to Reproduce:
1. Go to OperatorHub, check "Infrastructure features"

2. Create a custom CatalogSource:
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: tonywu-catsrc
  namespace: openshift-marketplace
spec:
  displayName: TW’s CatalogSource
  sourceType: grpc
  image: quay.io/tlwu2013/tw-index:latest

---

That includes a test version Portworx using the annotation following OCP doc:
https://docs.openshift.com/container-platform/4.7/operators/operator_sdk/osdk-generating-csvs.html#osdk-csv-manual-annotations_osdk-generating-csvs

3. Wait until "TW’s CatalogSource(1)" shows up under "Source" filer in the OperatorHub page.

4. Check "Infrastructure features" filter section again and check the filer options.


Actual results:
"Infrastructure features" filter shows:

- Disconnected(20)
- Proxy(2)
- disconnected(1)
- proxy-aware(1)


Expected results:
The "Infrastructure features" filter option maps annotations in both "old" and "new" format to a unified "Display format" string.

(UXD will follow up in finalizing the "Display format" string)


Additional info:
(UXD will follow up in finalizing the "Display format" string)

--- Additional comment from  on 2021-04-30 20:13:19 UTC ---



--- Additional comment from  on 2021-04-30 20:13:47 UTC ---



--- Additional comment from Peter Kreuser on 2021-05-03 17:52:36 UTC ---

For the infrastructure features filter lets go with the following facet terminology for the display strings:
- Cloud-Native Network Function
- Container Network Interface
- Container Storage Interface
- Disconnected
- FIPS Mode
- Proxy-aware

Comment 1 Yadan Pei 2021-05-12 03:20:37 UTC
1. Build an operator image quay.io/yapei/operatorinfras:latest in which the operator has  operators.openshift.io/infrastructure-features annotation with multiple values(valid and invalid)

    operators.openshift.io/infrastructure-features: >-
      ["disconnected", "cni", "cnf", "csi", "fips", "proxy-aware",
      "Disconnected", "FipsMode", "Proxy", "Unknown", "TestBacon"]

2. Deploy the operator within catalogsource 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: qe-catsrc
  namespace: openshift-marketplace
spec:
  displayName: Test Operators
  sourceType: grpc
  image: quay.io/yapei/operatorinfras:latest

3.Check `Infrastructure features` filter on OperatorHub page, no unknown types shown and all types are mapped correctly, see details in PR comment

Comment 2 Xiyun Zhao 2021-05-31 08:58:09 UTC
Failed for verify bug on payload 4.7.0-0.nightly-2021-05-29-015423
The unknown type of infrastructure-feature will shown on page which is not correct

Verify step:
1. Build an operator image quay.io/yapei/operatorinfras:latest in which the operator has  operators.openshift.io/infrastructure-features annotation with multiple values(valid and invalid)
    operators.openshift.io/infrastructure-features: >-
      ["disconnected", "cni", "cnf", "csi", "fips", "proxy-aware",
      "Disconnected", "FipsMode", "Proxy", "Unknown", "TestBacon"]
2. Deploy the operator within catalogsource 
   apiVersion: operators.coreos.com/v1alpha1
   kind: CatalogSource
   metadata:
     name: qe-catsrc
     namespace: openshift-marketplace
  spec:
     displayName: Test Operators
     sourceType: grpc
     image: quay.io/yapei/operatorinfras:latest
3. Wait until "TW’s CatalogSource(1)" shows up under "Source" filer in the OperatorHub page.
4. Check "Infrastructure features" filter on OperatorHub page
   Only below filter would be list on Infrastructure features filter part:
   {"Disconnected", "Container Network Interface", "Cloud-Native Network Function", "Container Storage Interface", "FIPS Mode,Proxy-aware"}
5. Click on the installed operator
6. Verify the "Infrastructure features" information is shown on the operator detail page, the unknown type of infrastructure features will be removed
   {"Disconnected", "Container Network Interface", "Cloud-Native Network Function", "Container Storage Interface", "FIPS Mode,Proxy-aware"}
7. Go back to OperatorHub page, use 'Kubestone' as a example who hasn't have operators.openshift.io/infrastructure-features annotation setting on image
8. Verify if infrastructure features with empty value will shown on operator modal

Result:
4,6. Failed (Attached snapshot:Infrastructure_features.png)
     Unknown types, like cni, cnf, Unknown is shown on "Infrastructure features" part on OperatorHub page and Operator details page
8. No 'Infrastructure feature' shown on operator modal if the operator doesn't have operators.openshift.io/infrastructure-features annotation defined

Additional info: 
  Related bug on 4.8 
   https://bugzilla.redhat.com/show_bug.cgi?id=1955803
   https://github.com/openshift/console/pull/8859#issuecomment-839410741

Comment 3 Yadan Pei 2021-06-01 00:46:43 UTC
(In reply to Xiyun Zhao from comment #2)
> Failed for verify bug on payload 4.7.0-0.nightly-2021-05-29-015423
> The unknown type of infrastructure-feature will shown on page which is not
> correct
> 
> Verify step:
> 1. Build an operator image quay.io/yapei/operatorinfras:latest in which the
> operator has  operators.openshift.io/infrastructure-features annotation with
> multiple values(valid and invalid)
>     operators.openshift.io/infrastructure-features: >-
>       ["disconnected", "cni", "cnf", "csi", "fips", "proxy-aware",
>       "Disconnected", "FipsMode", "Proxy", "Unknown", "TestBacon"]
> 2. Deploy the operator within catalogsource 
>    apiVersion: operators.coreos.com/v1alpha1
>    kind: CatalogSource
>    metadata:
>      name: qe-catsrc
>      namespace: openshift-marketplace
>   spec:
>      displayName: Test Operators
>      sourceType: grpc
>      image: quay.io/yapei/operatorinfras:latest
> 3. Wait until "TW’s CatalogSource(1)" shows up under "Source" filer in the
> OperatorHub page.
> 4. Check "Infrastructure features" filter on OperatorHub page
>    Only below filter would be list on Infrastructure features filter part:
>    {"Disconnected", "Container Network Interface", "Cloud-Native Network
> Function", "Container Storage Interface", "FIPS Mode,Proxy-aware"}
> 5. Click on the installed operator
> 6. Verify the "Infrastructure features" information is shown on the operator
> detail page, the unknown type of infrastructure features will be removed
>    {"Disconnected", "Container Network Interface", "Cloud-Native Network
> Function", "Container Storage Interface", "FIPS Mode,Proxy-aware"}
> 7. Go back to OperatorHub page, use 'Kubestone' as a example who hasn't have
> operators.openshift.io/infrastructure-features annotation setting on image
> 8. Verify if infrastructure features with empty value will shown on operator
> modal
> 
> Result:
> 4,6. Failed (Attached snapshot:Infrastructure_features.png)
>      Unknown types, like cni, cnf, Unknown is shown on "Infrastructure
> features" part on OperatorHub page and Operator details page
> 8. No 'Infrastructure feature' shown on operator modal if the operator
> doesn't have operators.openshift.io/infrastructure-features annotation
> defined
> 
> Additional info: 
>   Related bug on 4.8 
>    https://bugzilla.redhat.com/show_bug.cgi?id=1955803
>    https://github.com/openshift/console/pull/8859#issuecomment-839410741


Xiyun, fix PR is still in open status, you need to verify it on a cluster using cluster-bot not nightly

Comment 4 Xiyun Zhao 2021-06-01 02:55:30 UTC
Sorry for take the wrong payload.
This PR has been re-verified on private paload openshift/console#8859 by following upon Verify step. The Result ia as expected.

Result:
4,6. The "Infrastructure features" inforamtion can be found on operatorHub and operator detail page, the unknown type has been removed. the listed information as below shown which is as expected
   {"Disconnected", "Container Network Interface", "Cloud-Native Network Function", "Container Storage Interface", "FIPS Mode,Proxy-aware"}
8. No 'Infrastructure feature' shown on operator modal if the operator doesn't have operators.openshift.io/infrastructure-features annotation defined

Comment 7 Yadan Pei 2021-06-08 03:49:58 UTC
Confirmed the fix was merged in 4.7.0-0.nightly-2021-06-07-203428, since testing has been done prior merging moving to VERIFIED

Comment 9 errata-xmlrpc 2021-06-15 09:27:08 UTC
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.7.16 security and bug fix 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:2286