Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1693375 - [marketplace] Operator is creating invalid appregistry-server command
Summary: [marketplace] Operator is creating invalid appregistry-server command
Keywords:
Status: POST
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.1.0
Assignee: aravindh
QA Contact: Fan Jia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-27 16:47 UTC by Alexander Greene
Modified: 2019-03-29 16:24 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Alexander Greene 2019-03-27 16:47:16 UTC
A bug was introduced[1] that creates an invalid appregistry-server command. The lack of double quotes around the string assigned to `--registry` causes bash to interpret the `|` as a pipe rather than part of the registry string.

Background Information:
A deployment created as a result of a reconciled catalogsourceconfig defines the command that is ran in the pod below:
spec:
```
...
...
containers:
  - command:
    - appregistry-server
    - --registry=https://quay.io/cnr|marketplace_e2e --registry=https://quay.io/cnr|community-operators
    - -o
    - dynatrace,metering,svcat,mongodb,prometheus,amq-streams,clusterlogging,couchbase,descheduler,etcd,federationv2
...
...
```
 
The pod created by this deployment fails when running the command:
```
$ oc logs test-operators-68899b45db-npsnt 

time="2019-03-27T00:57:20Z" level=info msg="Using in-cluster kube client config" port=50051 type=appregistry
time="2019-03-27T00:57:20Z" level=info msg="operator source(s) specified are - [https://quay.io/cnr%7Cmarketplace_e2e --registry=https://quay.io/cnr%7Credhat-operators]" port=50051 type=appregistry
time="2019-03-27T00:57:20Z" level=info msg="package(s) specified are - federationv2,mongodb,svcat,couchbase,dynatrace,descheduler,etcd,metering,prometheus,amq-streams,clusterlogging" port=50051 type=appregistry
time="2019-03-27T00:57:20Z" level=error msg="the following error(s) occurred while parsing input - invalid source, secret specified is malformed - redhat-operators" port=50051 type=appregistry
time="2019-03-27T00:57:20Z" level=info msg="can't proceed, bailing out" port=50051 type=appregistry
time="2019-03-27T00:57:20Z" level=fatal msg="error loading manifest from remote registry - invalid source, secret specified is malformed - redhat-operators" port=50051 type=appregistry
```


Updating this command to include double quotes around the string assigned to `--registry` resolves this issue:
```
$  appregistry-server --registry="https://quay.io/cnr|redhat-operators" --registry="https://quay.io/cnr|marketplace_e2e" -o amq-streams,dynatrace,federationv2,metering,mongodb,prometheus,clusterlogging,couchbase,descheduler,etcd,svcat

time="2019-03-27T16:40:59Z" level=info msg="Using in-cluster kube client config" port=50051 type=appregistry
time="2019-03-27T16:40:59Z" level=info msg="operator source(s) specified are - [https://quay.io/cnr|redhat-operators https://quay.io/cnr|marketplace_e2e]" port=50051 type=appregistry
time="2019-03-27T16:40:59Z" level=info msg="package(s) specified are - amq-streams,dynatrace,federationv2,metering,mongodb,prometheus,clusterlogging,couchbase,descheduler,etcd,svcat" port=50051 type=appregistry
time="2019-03-27T16:40:59Z" level=info msg="input has been sanitized" port=50051 type=appregistry
time="2019-03-27T16:40:59Z" level=info msg="sources: [https://quay.io/cnr/redhat-operators https://quay.io/cnr/marketplace_e2e]" port=50051 type=appregistry
time="2019-03-27T16:40:59Z" level=info msg="packages: [amq-streams dynatrace federationv2 metering mongodb prometheus clusterlogging couchbase descheduler etcd svcat]" port=50051 type=appregistry
time="2019-03-27T16:41:00Z" level=info msg="resolved the following packages: [marketplace_e2e/dynatrace:0.2.0 marketplace_e2e/metering:0.12.0 marketplace_e2e/svcat:0.1.34 redhat-operators/amq-streams:1.0.2 marketplace_e2e/couchbase:1.0.0 marketplace_e2e/descheduler:0.0.1 marketplace_e2e/etcd:0.9.2 marketplace_e2e/federationv2:0.0.2 marketplace_e2e/mongodb:0.3.2 marketplace_e2e/prometheus:0.22.2 marketplace_e2e/clusterlogging:0.0.1]" port=50051 type=appregistry
time="2019-03-27T16:41:00Z" level=info msg="downloading repository: marketplace_e2e/dynatrace:0.2.0 from https://quay.io/cnr" port=50051 type=appregistry

```

[1] https://github.com/operator-framework/operator-marketplace/pull/139/files#diff-ed7d7c72ad9b4816a7ab9a3482c126a2R257

Comment 1 Fan Jia 2019-03-28 02:39:59 UTC
test env:
cv: 4.0.0-0.nightly-2019-03-26-215932
marketplace commit:e274d6b40505e977e12061becf27218f5eb717fb

create registory-server fail if download packages from multiple opsrc server after the pr https://github.com/operator-framework/operator-marketplace/pull/139/files#diff-ed7d7c72ad9b4816a7ab9a3482c126a2R257.


Note You need to log in before you can comment on or make changes to this bug.