Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator catalog is created but now shown in the OLM UI #822

Closed
ldimaggi opened this issue Apr 24, 2019 · 4 comments
Closed

Operator catalog is created but now shown in the OLM UI #822

ldimaggi opened this issue Apr 24, 2019 · 4 comments

Comments

@ldimaggi
Copy link

ldimaggi commented Apr 24, 2019

Steps to recreate:
Start up an OS4 cluster

Create a CatalogSource:

cat devconsole.operatorsource.catalog.yamlapiVersion: operators.coreos.com/v1
kind: CatalogSourceConfig
metadata:
  name: devconsole-operator-catalog
  namespace: openshift-operators
spec:
  targetNamespace: local-operators
  packages: devconsole-operator
  displayName: Red Hat Devconsole Operator
  publisher: Red Hat

Apply the CatalogSource:

kubectl apply -f devconsole.operatorsource.catalog.yamlcatalogsourceconfig "devconsole-operator-catalog" configured

Verify the CatalogSource in the CLI:

kubectl get CatalogSourceConfig devconsole-operator-catalog -n openshift-operators -o=yaml
apiVersion: operators.coreos.com/v1
kind: CatalogSourceConfig
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"operators.coreos.com/v1","kind":"CatalogSourceConfig","metadata":{"annotations":{},"name":"devconsole-operator-catalog","namespace":"openshift-operators"},"spec":{"displayName":"Red Hat Devconsole Operator","packages":"devconsole-operator","publisher":"Red Hat","targetNamespace":"local-operators"}}
  creationTimestamp: 2019-04-25T17:19:11Z
  generation: 1
  name: devconsole-operator-catalog
  namespace: openshift-operators
  resourceVersion: "41007"
  selfLink: /apis/operators.coreos.com/v1/namespaces/openshift-operators/catalogsourceconfigs/devconsole-operator-catalog
  uid: 3e1a55ff-677e-11e9-8124-06472ef5fc02
spec:
  displayName: Red Hat Devconsole Operator
  packages: devconsole-operator
  publisher: Red Hat
  targetNamespace: local-operators

But - the CatalogSource is not displayed in the UI:
Screenshot from 2019-04-25 13-34-39

@ldimaggi ldimaggi changed the title Error retrieving operator catalog is displayed but is not persistent Operator catalog is created but now shown in the OLM UI Apr 25, 2019
@pmacik
Copy link

pmacik commented Apr 26, 2019

@ldimaggi According to https://github.com/operator-framework/operator-marketplace#catalogsourceconfig, a CatalogSource instance is supposed to be created behind the scenes from the CataloSourceConfig.
I cannot see that happen, see the following sequence:

(operator-test-env)➜  oc project openshift-operators
Already on project "openshift-operators" on server "https://api.pmacik.devcluster.openshift.com:6443".

Verify that no CatalogSoruce is not present:

(operator-test-env)➜  oc get catsrc
No resources found.

Verify that no CatalogSourceConfig is not present:

(operator-test-env)➜  oc get csc
No resources found.

Create a CatalogSourceConfig:

(operator-test-env)➜  cat devconsole.operatorsource.catalog.yaml 
apiVersion: operators.coreos.com/v1
kind: CatalogSourceConfig
metadata:
  name: devconsole-operator-catalog
  namespace: openshift-operators
spec:
  targetNamespace: local-operators
  packages: devconsole-operator
  csDisplayName: "Red Hat Devconsole Operator"
  csPublisher: "Red Hat"
(operator-test-env)➜  oc apply -f devconsole.operatorsource.catalog.yaml 
catalogsourceconfig.operators.coreos.com/devconsole-operator-catalog created

Verify that the CatalogSourceConfig is present:

(operator-test-env)➜  oc get csc -o=yaml
apiVersion: v1
items:
- apiVersion: operators.coreos.com/v1
  kind: CatalogSourceConfig
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"operators.coreos.com/v1","kind":"CatalogSourceConfig","metadata":{"annotations":{},"name":"devconsole-operator-catalog","namespace":"openshift-operators"},"spec":{"csDisplayName":"Red Hat Devconsole Operator","csPublisher":"Red Hat","packages":"devconsole-operator","targetNamespace":"local-operators"}}
    creationTimestamp: "2019-04-26T07:47:48Z"
    generation: 1
    name: devconsole-operator-catalog
    namespace: openshift-operators
    resourceVersion: "440021"
    selfLink: /apis/operators.coreos.com/v1/namespaces/openshift-operators/catalogsourceconfigs/devconsole-operator-catalog
    uid: 96467ced-67f7-11e9-b95f-02c0b0e73e24
  spec:
    csDisplayName: Red Hat Devconsole Operator
    csPublisher: Red Hat
    packages: devconsole-operator
    targetNamespace: local-operators
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

Check for the CatalogSource:

(operator-test-env)➜  oc get catsrc --all-namespaces
NAMESPACE                              NAME                  NAME                  TYPE       PUBLISHER   AGE
openshift-marketplace                  certified-operators   Certified Operators   grpc       Red Hat     24h
openshift-marketplace                  community-operators   Community Operators   grpc       Red Hat     24h
openshift-marketplace                  redhat-operators      Red Hat Operators     grpc       Red Hat     24h
openshift-operator-lifecycle-manager   olm-operators         OLM Operators         internal   Red Hat     24h

So CatalogSourceConfig is created, but CatalogSource (which is supposed to be created from the CatalogSourceConfig) is not.

@pmacik
Copy link

pmacik commented Apr 26, 2019

I just realized, that the CatalogSourceConfig should probably be placed in the openshift-marketplace namespace:

(operator-test-env)➜   oc get csc --all-namespaces
NAMESPACE               NAME                  STATUS      MESSAGE                                       AGE
openshift-marketplace   certified-operators   Succeeded   The object has been successfully reconciled   29h
openshift-marketplace   community-operators   Succeeded   The object has been successfully reconciled   29h
openshift-marketplace   redhat-operators      Succeeded   The object has been successfully reconciled   29h

(operator-test-env)➜   oc get catsrc --all-namespaces
NAMESPACE                              NAME                  NAME                  TYPE       PUBLISHER   AGE
openshift-marketplace                  certified-operators   Certified Operators   grpc       Red Hat     29h
openshift-marketplace                  community-operators   Community Operators   grpc       Red Hat     29h
openshift-marketplace                  redhat-operators      Red Hat Operators     grpc       Red Hat     29h
openshift-operator-lifecycle-manager   olm-operators         OLM Operators         internal   Red Hat     30h

(operator-test-env)➜   oc get opsrc --all-namespaces
NAMESPACE               NAME                  TYPE          ENDPOINT              REGISTRY              DISPLAYNAME           PUBLISHER   STATUS      MESSAGE                                       AGE
openshift-marketplace   certified-operators   appregistry   https://quay.io/cnr   certified-operators   Certified Operators   Red Hat     Succeeded   The object has been successfully reconciled   30h
openshift-marketplace   community-operators   appregistry   https://quay.io/cnr   community-operators   Community Operators   Red Hat     Succeeded   The object has been successfully reconciled   30h
openshift-marketplace   redhat-operators      appregistry   https://quay.io/cnr   redhat-operators      Red Hat Operators     Red Hat     Succeeded   The object has been successfully reconciled   30h

@pmacik
Copy link

pmacik commented Apr 26, 2019

@ldimaggi
Copy link
Author

ldimaggi commented May 2, 2019

Closing as not a bug - the approach followed was not correct.

@ldimaggi ldimaggi closed this as completed May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants