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

Cannot upgrade operator from v1alpha1 to v1beta1 #1180

Closed
clyang82 opened this issue Dec 9, 2019 · 4 comments
Closed

Cannot upgrade operator from v1alpha1 to v1beta1 #1180

clyang82 opened this issue Dec 9, 2019 · 4 comments

Comments

@clyang82
Copy link
Contributor

clyang82 commented Dec 9, 2019

I am running an example app-operator on top of openshift 4.2. the olm version is 0.11. I have create the app-operator version 0.0.1/0.0.2/1.0.0. I can successfully upgrade from 0.0.1 to 0.0.2 by using olm. After pushed a new version 1.0.0 with the version change to v1beta1, then the operator cannot be upgraded successfully.

NAME                  DISPLAY        VERSION   REPLACES              PHASE
app-operator.v0.0.2   App Operator   0.0.2     app-operator.v0.0.1   Succeeded```

the catalogsource shows the 1.0.0 is loaded

[root@cyang-oc2-inf ~]# oc logs -f -n openshift-marketplace clyang-operators-788c54dcf5-brczn
time="2019-12-09T08:32:56Z" level=info msg="Using in-cluster kube client config" port=50051 type=appregistry
time="2019-12-09T08:32:56Z" level=info msg="operator source(s) specified are - [https://quay.io/cnr|clyang82]" port=50051 type=appregistry
time="2019-12-09T08:32:56Z" level=info msg="package(s) specified are - app-operator,memcached-operator" port=50051 type=appregistry
time="2019-12-09T08:32:56Z" level=info msg="input has been sanitized" port=50051 type=appregistry
time="2019-12-09T08:32:56Z" level=info msg="sources: [https://quay.io/cnr/clyang82]" port=50051 type=appregistry
time="2019-12-09T08:32:56Z" level=info msg="packages: [app-operator memcached-operator]" port=50051 type=appregistry
time="2019-12-09T08:32:57Z" level=info msg="resolved the following packages: [clyang82/app-operator:1.0.0 clyang82/memcached-operator:0.0.9]" port=50051 type=appregistry
time="2019-12-09T08:32:57Z" level=info msg="downloading repository: clyang82/app-operator:1.0.0 from https://quay.io/cnr" port=50051 type=appregistry
time="2019-12-09T08:32:57Z" level=info msg="downloading repository: clyang82/memcached-operator:0.0.9 from https://quay.io/cnr" port=50051 type=appregistry
time="2019-12-09T08:32:57Z" level=info msg="download complete - 2 repositories have been downloaded" port=50051 type=appregistry
time="2019-12-09T08:32:57Z" level=info msg="decoded 0 flattened and 2 nested operator manifest(s)" port=50051 type=appregistry
time="2019-12-09T08:32:57Z" level=info msg="loading Bundles" dir=downloaded
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=downloaded load=bundles
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=app-operator load=bundles
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=app-operator-jgc35eb6 load=bundles
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=0.0.1 load=bundles
time="2019-12-09T08:32:57Z" level=info msg="found csv, loading bundle" dir=downloaded file=app-operator.v0.0.1.clusterserviceversion.yaml load=bundles
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=app-operator.v0.0.1.clusterserviceversion.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=app.example.com_appservices_crd.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=0.0.2 load=bundles
time="2019-12-09T08:32:57Z" level=info msg="found csv, loading bundle" dir=downloaded file=app-operator.v0.0.2.clusterserviceversion.yaml load=bundles
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=app-operator.v0.0.2.clusterserviceversion.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=app.example.com_appservices_crd.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=1.0.0 load=bundles
time="2019-12-09T08:32:57Z" level=info msg="found csv, loading bundle" dir=downloaded file=app-operator.v1.0.0.clusterserviceversion.yaml load=bundles
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=app-operator.v1.0.0.clusterserviceversion.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=app.example.com_appservices_crd.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=memcached-operator load=bundles
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=memcached-operator-khv1bjdy load=bundles
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=0.0.1 load=bundles
time="2019-12-09T08:32:57Z" level=info msg="found csv, loading bundle" dir=downloaded file=memcached-operator.v0.0.1.clusterserviceversion.yaml load=bundles
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=cache.example.com_memcacheds_crd.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=memcached-operator.v0.0.1.clusterserviceversion.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=0.0.9 load=bundles
time="2019-12-09T08:32:57Z" level=info msg="found csv, loading bundle" dir=downloaded file=memcached-operator.v0.0.9.clusterserviceversion.yaml load=bundles
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=cache.example.com_memcacheds_crd.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg="loading bundle file" dir=downloaded file=memcached-operator.v0.0.9.clusterserviceversion.yaml load=bundle
time="2019-12-09T08:32:57Z" level=info msg="loading Packages and Entries" dir=downloaded
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=downloaded load=package
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=app-operator load=package
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=app-operator-jgc35eb6 load=package
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=0.0.1 load=package
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=0.0.2 load=package
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=1.0.0 load=package
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=memcached-operator load=package
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=memcached-operator-khv1bjdy load=package
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=0.0.1 load=package
time="2019-12-09T08:32:57Z" level=info msg=directory dir=downloaded file=0.0.9 load=package
time="2019-12-09T08:32:57Z" level=info msg="serving registry" port=50051 type=appregistry

the packagemanifest shows the v1beta1 information as well

[root@cyang-oc2-inf ~]# oc get packagemanifest app-operator -oyaml
apiVersion: packages.operators.coreos.com/v1
kind: PackageManifest
metadata:
  creationTimestamp: "2019-12-09T03:28:04Z"
  labels:
    catalog: clyang-operators
    catalog-namespace: openshift-marketplace
    olm-visibility: hidden
    openshift-marketplace: "true"
    opsrc-datastore: "true"
    opsrc-owner-name: clyang-operators
    opsrc-owner-namespace: openshift-marketplace
    provider: ""
    provider-url: ""
  name: app-operator
  namespace: default
  selfLink: /apis/packages.operators.coreos.com/v1/namespaces/default/packagemanifests/app-operator
spec: {}
status:
  catalogSource: clyang-operators
  catalogSourceDisplayName: ""
  catalogSourceNamespace: openshift-marketplace
  catalogSourcePublisher: ""
  channels:
  - currentCSV: app-operator.v0.0.2
    currentCSVDesc:
      annotations:
        alm-examples: |-
          [
            {
              "apiVersion": "app.example.com/v1alpha1",
              "kind": "AppService",
              "metadata": {
                "name": "example-appservice"
              },
              "spec": {
                "size": 3
              }
            }
          ]
        capabilities: Basic Install
      apiservicedefinitions: {}
      customresourcedefinitions:
        owned:
        - description: Placeholder description
          displayName: App Operator
          kind: AppService
          name: appservices.app.example.com
          version: v1alpha1
      description: Placeholder description
      displayName: App Operator
      installModes:
      - supported: true
        type: OwnNamespace
      - supported: true
        type: SingleNamespace
      - supported: false
        type: MultiNamespace
      - supported: true
        type: AllNamespaces
      provider: {}
      version: 0.0.2
    name: alpha
  - currentCSV: app-operator.v1.0.0
    currentCSVDesc:
      annotations:
        alm-examples: |-
          [
            {
              "apiVersion": "app.example.com/v1beta1",
              "kind": "AppService",
              "metadata": {
                "name": "example-appservice"
              },
              "spec": {
                "size": 3
              }
            }
          ]
        capabilities: Basic Install
      apiservicedefinitions: {}
      customresourcedefinitions:
        owned:
        - description: Placeholder description
          displayName: App Operator
          kind: AppService
          name: appservices.app.example.com
          version: v1beta1
      description: Placeholder description
      displayName: App Operator
      installModes:
      - supported: true
        type: OwnNamespace
      - supported: true
        type: SingleNamespace
      - supported: false
        type: MultiNamespace
      - supported: true
        type: AllNamespaces
      provider: {}
      version: 1.0.0
    name: beta
  defaultChannel: beta
  packageName: app-operator
  provider: {}

The example source code is in https://github.com/clyang82/app-operator/tree/1.0.0/deploy/olm-catalog/app-operator

Am I missed anything? Which logs I need to check further? Thanks for your help.

@ecordell
Copy link
Member

ecordell commented Dec 9, 2019

Without further information, my guess is that the update is failing due to your changes to the underlying CRDs.

Please see this doc: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/design/dependency-resolution.md#add-a-new-version-to-crd

On how CRD updates must be handled to ensure your update doesn’t break existing installations.

To further debug, could you show:

  • the status of the subscription
  • the status of the installplan
  • the status of any csvs (do you see the new CSV get created at all?)
  • the logs of olm-operator and catalog-operator in openshift-operator-lifecycle-manager

@clyang82
Copy link
Contributor Author

clyang82 commented Dec 9, 2019

@ecordell Thanks for your support. Here are further debug information:

the status of the subscription

[root@cyang-oc2-inf ~]# oc get subscription -oyaml my-operator-subsription
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"operators.coreos.com/v1alpha1","kind":"Subscription","metadata":{"annotations":{},"name":"my-operator-subsription","namespace":"default"},"spec":{"channel":"alpha","installPlanApproval":"Automatic","name":"app-operator","source":"clyang-operators","sourceNamespace":"openshift-marketplace"}}
  creationTimestamp: "2019-12-09T07:44:06Z"
  generation: 1
  name: my-operator-subsription
  namespace: default
  resourceVersion: "4135717"
  selfLink: /apis/operators.coreos.com/v1alpha1/namespaces/default/subscriptions/my-operator-subsription
  uid: adb8a657-1a57-11ea-886b-00000a101185
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: app-operator
  source: clyang-operators
  sourceNamespace: openshift-marketplace
status:
  catalogHealth:
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: certified-operators
      namespace: openshift-marketplace
      resourceVersion: "4128057"
      uid: cfcd9922-14db-11ea-8db9-00000a101185
    healthy: true
    lastUpdated: "2019-12-09T07:44:07Z"
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: clyang-operators
      namespace: openshift-marketplace
      resourceVersion: "4130794"
      uid: e9268383-1a33-11ea-886b-00000a101185
    healthy: true
    lastUpdated: "2019-12-09T07:44:07Z"
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: community-operators
      namespace: openshift-marketplace
      resourceVersion: "4128071"
      uid: d040004d-14db-11ea-8db9-00000a101185
    healthy: true
    lastUpdated: "2019-12-09T07:44:07Z"
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: integreatly-operators
      namespace: openshift-marketplace
      resourceVersion: "4128076"
      uid: 0a98016a-167a-11ea-bd0e-00000a101185
    healthy: true
    lastUpdated: "2019-12-09T07:44:07Z"
  - catalogSourceRef:
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      name: redhat-operators
      namespace: openshift-marketplace
      resourceVersion: "4128092"
      uid: cf75ed64-14db-11ea-8db9-00000a101185
    healthy: true
    lastUpdated: "2019-12-09T07:44:07Z"
  conditions:
  - lastTransitionTime: "2019-12-09T07:44:07Z"
    message: all available catalogsources are healthy
    reason: AllCatalogSourcesHealthy
    status: "False"
    type: CatalogSourcesUnhealthy
  currentCSV: app-operator.v0.0.2
  installPlanRef:
    apiVersion: operators.coreos.com/v1alpha1
    kind: InstallPlan
    name: install-kxvlr
    namespace: default
    resourceVersion: "4135615"
    uid: d95f0f0e-1a58-11ea-886b-00000a101185
  installedCSV: app-operator.v0.0.2
  installplan:
    apiVersion: operators.coreos.com/v1alpha1
    kind: InstallPlan
    name: install-kxvlr
    uuid: d95f0f0e-1a58-11ea-886b-00000a101185
  lastUpdated: "2019-12-09T07:52:39Z"
  state: AtLatestKnown

the status of the installplan

[root@cyang-oc2-inf ~]# oc get ip
NAME            CSV                                         APPROVAL    APPROVED
install-6q2fc   app-operator.v0.0.1                         Automatic   true
install-kxvlr   app-operator.v0.0.2                         Automatic   true
[root@cyang-oc2-inf ~]# oc get ip -oyaml install-kxvlr
apiVersion: operators.coreos.com/v1alpha1
kind: InstallPlan
metadata:
  creationTimestamp: "2019-12-09T07:52:29Z"
  generateName: install-
  generation: 1
  name: install-kxvlr
  namespace: default
  ownerReferences:
  - apiVersion: operators.coreos.com/v1alpha1
    blockOwnerDeletion: false
    controller: false
    kind: Subscription
    name: my-operator-subsription
    uid: adb8a657-1a57-11ea-886b-00000a101185
  resourceVersion: "4135689"
  selfLink: /apis/operators.coreos.com/v1alpha1/namespaces/default/installplans/install-kxvlr
  uid: d95f0f0e-1a58-11ea-886b-00000a101185
spec:
  approval: Automatic
  approved: true
  clusterServiceVersionNames:
  - app-operator.v0.0.2
status:
  catalogSources:
  - clyang-operators
  conditions:
  - lastTransitionTime: "2019-12-09T07:52:29Z"
    lastUpdateTime: "2019-12-09T07:52:29Z"
    status: "True"
    type: Installed
  phase: Complete
  plan:
  - resolving: app-operator.v0.0.2
    resource:
      group: operators.coreos.com
      kind: ClusterServiceVersion
      manifest: |
        {"kind":"ClusterServiceVersion","apiVersion":"operators.coreos.com/v1alpha1","metadata":{"name":"app-operator.v0.0.2","namespace":"default","creationTimestamp":null,"annotations":{"alm-examples":"[\n  {\n    \"apiVersion\": \"app.example.com/v1alpha1\",\n    \"kind\": \"AppService\",\n    \"metadata\": {\n      \"name\": \"example-appservice\"\n    },\n    \"spec\": {\n      \"size\": 3\n    }\n  }\n]","capabilities":"Basic Install"}},"spec":{"install":{"strategy":"deployment","spec":{"deployments":[{"name":"app-operator","spec":{"replicas":1,"selector":{"matchLabels":{"name":"app-operator"}},"strategy":{},"template":{"metadata":{"labels":{"name":"app-operator"}},"spec":{"containers":[{"command":["app-operator"],"env":[{"name":"WATCH_NAMESPACE","valueFrom":{"fieldRef":{"fieldPath":"metadata.annotations['olm.targetNamespaces']"}}},{"name":"POD_NAME","valueFrom":{"fieldRef":{"fieldPath":"metadata.name"}}},{"name":"OPERATOR_NAME","value":"app-operator"}],"image":"clyang/app-operator:v0.0.1","imagePullPolicy":"Always","name":"app-operator","resources":{}}],"serviceAccountName":"app-operator"}}}}],"permissions":[{"rules":[{"apiGroups":[""],"resources":["pods","services","services/finalizers","endpoints","persistentvolumeclaims","events","configmaps","secrets"],"verbs":["*"]},{"apiGroups":["apps"],"resources":["deployments","daemonsets","replicasets","statefulsets"],"verbs":["*"]},{"apiGroups":["monitoring.coreos.com"],"resources":["servicemonitors"],"verbs":["get","create"]},{"apiGroups":["apps"],"resourceNames":["app-operator"],"resources":["deployments/finalizers"],"verbs":["update"]},{"apiGroups":[""],"resources":["pods"],"verbs":["get"]},{"apiGroups":["apps"],"resources":["replicasets","deployments"],"verbs":["get"]},{"apiGroups":["app.example.com"],"resources":["*"],"verbs":["*"]}],"serviceAccountName":"app-operator"}]}},"version":"0.0.2","maturity":"alpha","customresourcedefinitions":{"owned":[{"name":"appservices.app.example.com","version":"v1alpha1","kind":"AppService","displayName":"App Operator","description":"Placeholder description"}]},"apiservicedefinitions":{},"minKubeVersion":"1.11.3","displayName":"App Operator","description":"Placeholder description","provider":{},"installModes":[{"type":"OwnNamespace","supported":true},{"type":"SingleNamespace","supported":true},{"type":"MultiNamespace","supported":false},{"type":"AllNamespaces","supported":true}],"replaces":"app-operator.v0.0.1"},"status":{"lastUpdateTime":null,"lastTransitionTime":null,"certsLastUpdated":null,"certsRotateAt":null}}
      name: app-operator.v0.0.2
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1alpha1
    status: Created
  - resolving: app-operator.v0.0.2
    resource:
      group: apiextensions.k8s.io
      kind: CustomResourceDefinition
      manifest: |
        {"apiVersion":"apiextensions.k8s.io/v1beta1","kind":"CustomResourceDefinition","metadata":{"name":"appservices.app.example.com"},"spec":{"group":"app.example.com","names":{"kind":"AppService","listKind":"AppServiceList","plural":"appservices","singular":"appservice"},"scope":"Namespaced","subresources":{"status":{}},"validation":{"openAPIV3Schema":{"description":"AppService is the Schema for the appservices API","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds","type":"string"},"metadata":{"type":"object"},"spec":{"description":"AppServiceSpec defines the desired state of AppService","type":"object"},"status":{"description":"AppServiceStatus defines the observed state of AppService","type":"object"}},"type":"object"}},"version":"v1alpha1","versions":[{"name":"v1alpha1","served":true,"storage":true}]}}
      name: appservices.app.example.com
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1beta1
    status: Present
  - resolving: app-operator.v0.0.2
    resource:
      group: ""
      kind: ServiceAccount
      manifest: |
        {"metadata":{"name":"app-operator","namespace":"default","creationTimestamp":null,"ownerReferences":[{"apiVersion":"operators.coreos.com/v1alpha1","kind":"ClusterServiceVersion","name":"app-operator.v0.0.2","uid":"","controller":false,"blockOwnerDeletion":false}]}}
      name: app-operator
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1
    status: Present
  - resolving: app-operator.v0.0.2
    resource:
      group: rbac.authorization.k8s.io
      kind: Role
      manifest: |
        {"metadata":{"name":"app-operator.v0.0.2-mvhh9","namespace":"default","creationTimestamp":null,"labels":{"olm.owner":"app-operator.v0.0.2","olm.owner.kind":"ClusterServiceVersion","olm.owner.namespace":"default"},"ownerReferences":[{"apiVersion":"operators.coreos.com/v1alpha1","kind":"ClusterServiceVersion","name":"app-operator.v0.0.2","uid":"","controller":false,"blockOwnerDeletion":false}]},"rules":[{"verbs":["*"],"apiGroups":[""],"resources":["pods","services","services/finalizers","endpoints","persistentvolumeclaims","events","configmaps","secrets"]},{"verbs":["*"],"apiGroups":["apps"],"resources":["deployments","daemonsets","replicasets","statefulsets"]},{"verbs":["get","create"],"apiGroups":["monitoring.coreos.com"],"resources":["servicemonitors"]},{"verbs":["update"],"apiGroups":["apps"],"resources":["deployments/finalizers"],"resourceNames":["app-operator"]},{"verbs":["get"],"apiGroups":[""],"resources":["pods"]},{"verbs":["get"],"apiGroups":["apps"],"resources":["replicasets","deployments"]},{"verbs":["*"],"apiGroups":["app.example.com"],"resources":["*"]}]}
      name: app-operator.v0.0.2-mvhh9
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1
    status: Created
  - resolving: app-operator.v0.0.2
    resource:
      group: rbac.authorization.k8s.io
      kind: RoleBinding
      manifest: |
        {"metadata":{"name":"app-operator.v0.0.2-mvhh9-app-operator-mrgtc","namespace":"default","creationTimestamp":null,"labels":{"olm.owner":"app-operator.v0.0.2","olm.owner.kind":"ClusterServiceVersion","olm.owner.namespace":"default"},"ownerReferences":[{"apiVersion":"operators.coreos.com/v1alpha1","kind":"ClusterServiceVersion","name":"app-operator.v0.0.2","uid":"","controller":false,"blockOwnerDeletion":false}]},"subjects":[{"kind":"ServiceAccount","name":"app-operator","namespace":"default"}],"roleRef":{"apiGroup":"rbac.authorization.k8s.io","kind":"Role","name":"app-operator.v0.0.2-mvhh9"}}
      name: app-operator.v0.0.2-mvhh9-app-operator-mrgtc
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1
    status: Created
[root@cyang-oc2-inf ~]# oc get ip -oyaml install-6q2fc
apiVersion: operators.coreos.com/v1alpha1
kind: InstallPlan
metadata:
  creationTimestamp: "2019-12-09T07:44:10Z"
  generateName: install-
  generation: 1
  name: install-6q2fc
  namespace: default
  ownerReferences:
  - apiVersion: operators.coreos.com/v1alpha1
    blockOwnerDeletion: false
    controller: false
    kind: Subscription
    name: my-operator-subsription
    uid: adb8a657-1a57-11ea-886b-00000a101185
  resourceVersion: "4131037"
  selfLink: /apis/operators.coreos.com/v1alpha1/namespaces/default/installplans/install-6q2fc
  uid: b007e53d-1a57-11ea-886b-00000a101185
spec:
  approval: Automatic
  approved: true
  clusterServiceVersionNames:
  - app-operator.v0.0.1
status:
  catalogSources:
  - clyang-operators
  conditions:
  - lastTransitionTime: "2019-12-09T07:44:11Z"
    lastUpdateTime: "2019-12-09T07:44:11Z"
    status: "True"
    type: Installed
  phase: Complete
  plan:
  - resolving: app-operator.v0.0.1
    resource:
      group: operators.coreos.com
      kind: ClusterServiceVersion
      manifest: |
        {"kind":"ClusterServiceVersion","apiVersion":"operators.coreos.com/v1alpha1","metadata":{"name":"app-operator.v0.0.1","namespace":"default","creationTimestamp":null,"annotations":{"alm-examples":"[\n  {\n    \"apiVersion\": \"app.example.com/v1alpha1\",\n    \"kind\": \"AppService\",\n    \"metadata\": {\n      \"name\": \"example-appservice\"\n    },\n    \"spec\": {\n      \"size\": 3\n    }\n  }\n]","capabilities":"Basic Install"}},"spec":{"install":{"strategy":"deployment","spec":{"deployments":[{"name":"app-operator","spec":{"replicas":1,"selector":{"matchLabels":{"name":"app-operator"}},"strategy":{},"template":{"metadata":{"labels":{"name":"app-operator"}},"spec":{"containers":[{"command":["app-operator"],"env":[{"name":"WATCH_NAMESPACE","valueFrom":{"fieldRef":{"fieldPath":"metadata.annotations['olm.targetNamespaces']"}}},{"name":"POD_NAME","valueFrom":{"fieldRef":{"fieldPath":"metadata.name"}}},{"name":"OPERATOR_NAME","value":"app-operator"}],"image":"clyang/app-operator:v0.0.1","imagePullPolicy":"Always","name":"app-operator","resources":{}}],"serviceAccountName":"app-operator"}}}}],"permissions":[{"rules":[{"apiGroups":[""],"resources":["pods","services","services/finalizers","endpoints","persistentvolumeclaims","events","configmaps","secrets"],"verbs":["*"]},{"apiGroups":["apps"],"resources":["deployments","daemonsets","replicasets","statefulsets"],"verbs":["*"]},{"apiGroups":["monitoring.coreos.com"],"resources":["servicemonitors"],"verbs":["get","create"]},{"apiGroups":["apps"],"resourceNames":["app-operator"],"resources":["deployments/finalizers"],"verbs":["update"]},{"apiGroups":[""],"resources":["pods"],"verbs":["get"]},{"apiGroups":["apps"],"resources":["replicasets","deployments"],"verbs":["get"]},{"apiGroups":["app.example.com"],"resources":["*"],"verbs":["*"]}],"serviceAccountName":"app-operator"}]}},"version":"0.0.1","maturity":"alpha","customresourcedefinitions":{"owned":[{"name":"appservices.app.example.com","version":"v1alpha1","kind":"AppService","displayName":"App Operator","description":"Placeholder description"}]},"apiservicedefinitions":{},"minKubeVersion":"1.11.3","displayName":"App Operator","description":"Placeholder description","provider":{},"installModes":[{"type":"OwnNamespace","supported":true},{"type":"SingleNamespace","supported":true},{"type":"MultiNamespace","supported":false},{"type":"AllNamespaces","supported":true}]},"status":{"lastUpdateTime":null,"lastTransitionTime":null,"certsLastUpdated":null,"certsRotateAt":null}}
      name: app-operator.v0.0.1
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1alpha1
    status: Created
  - resolving: app-operator.v0.0.1
    resource:
      group: apiextensions.k8s.io
      kind: CustomResourceDefinition
      manifest: |
        {"apiVersion":"apiextensions.k8s.io/v1beta1","kind":"CustomResourceDefinition","metadata":{"name":"appservices.app.example.com"},"spec":{"group":"app.example.com","names":{"kind":"AppService","listKind":"AppServiceList","plural":"appservices","singular":"appservice"},"scope":"Namespaced","subresources":{"status":{}},"validation":{"openAPIV3Schema":{"description":"AppService is the Schema for the appservices API","properties":{"apiVersion":{"description":"APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources","type":"string"},"kind":{"description":"Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds","type":"string"},"metadata":{"type":"object"},"spec":{"description":"AppServiceSpec defines the desired state of AppService","type":"object"},"status":{"description":"AppServiceStatus defines the observed state of AppService","type":"object"}},"type":"object"}},"version":"v1alpha1","versions":[{"name":"v1alpha1","served":true,"storage":true}]}}
      name: appservices.app.example.com
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1beta1
    status: Present
  - resolving: app-operator.v0.0.1
    resource:
      group: ""
      kind: ServiceAccount
      manifest: |
        {"metadata":{"name":"app-operator","namespace":"default","creationTimestamp":null,"ownerReferences":[{"apiVersion":"operators.coreos.com/v1alpha1","kind":"ClusterServiceVersion","name":"app-operator.v0.0.1","uid":"","controller":false,"blockOwnerDeletion":false}]}}
      name: app-operator
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1
    status: Created
  - resolving: app-operator.v0.0.1
    resource:
      group: rbac.authorization.k8s.io
      kind: Role
      manifest: |
        {"metadata":{"name":"app-operator.v0.0.1-rxnff","namespace":"default","creationTimestamp":null,"labels":{"olm.owner":"app-operator.v0.0.1","olm.owner.kind":"ClusterServiceVersion","olm.owner.namespace":"default"},"ownerReferences":[{"apiVersion":"operators.coreos.com/v1alpha1","kind":"ClusterServiceVersion","name":"app-operator.v0.0.1","uid":"","controller":false,"blockOwnerDeletion":false}]},"rules":[{"verbs":["*"],"apiGroups":[""],"resources":["pods","services","services/finalizers","endpoints","persistentvolumeclaims","events","configmaps","secrets"]},{"verbs":["*"],"apiGroups":["apps"],"resources":["deployments","daemonsets","replicasets","statefulsets"]},{"verbs":["get","create"],"apiGroups":["monitoring.coreos.com"],"resources":["servicemonitors"]},{"verbs":["update"],"apiGroups":["apps"],"resources":["deployments/finalizers"],"resourceNames":["app-operator"]},{"verbs":["get"],"apiGroups":[""],"resources":["pods"]},{"verbs":["get"],"apiGroups":["apps"],"resources":["replicasets","deployments"]},{"verbs":["*"],"apiGroups":["app.example.com"],"resources":["*"]}]}
      name: app-operator.v0.0.1-rxnff
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1
    status: Created
  - resolving: app-operator.v0.0.1
    resource:
      group: rbac.authorization.k8s.io
      kind: RoleBinding
      manifest: |
        {"metadata":{"name":"app-operator.v0.0.1-rxnff-app-operator-q9ckz","namespace":"default","creationTimestamp":null,"labels":{"olm.owner":"app-operator.v0.0.1","olm.owner.kind":"ClusterServiceVersion","olm.owner.namespace":"default"},"ownerReferences":[{"apiVersion":"operators.coreos.com/v1alpha1","kind":"ClusterServiceVersion","name":"app-operator.v0.0.1","uid":"","controller":false,"blockOwnerDeletion":false}]},"subjects":[{"kind":"ServiceAccount","name":"app-operator","namespace":"default"}],"roleRef":{"apiGroup":"rbac.authorization.k8s.io","kind":"Role","name":"app-operator.v0.0.1-rxnff"}}
      name: app-operator.v0.0.1-rxnff-app-operator-q9ckz
      sourceName: clyang-operators
      sourceNamespace: openshift-marketplace
      version: v1
    status: Created

the status of any csvs (do you see the new CSV get created at all?) I did not saw any new CSV get created.

[root@cyang-oc2-inf ~]# oc get csv
NAME                                        DISPLAY                  VERSION              REPLACES              PHASE
app-operator.v0.0.2                         App Operator             0.0.2                app-operator.v0.0.1   Succeeded

the logs of olm-operator and catalog-operator in openshift-operator-lifecycle-manager

catalog-operator.log
olm-operator.log

@ecordell
Copy link
Member

ecordell commented Dec 9, 2019

@clyang82 Your subscription specifies channel: alpha, which indicates that the latest version is 0.0.2: https://github.com/clyang82/app-operator/blob/1.0.0/deploy/olm-catalog/app-operator/app-operator.package.yaml#L2

If you try with channel: beta, you should see the update go through.

@clyang82
Copy link
Contributor Author

clyang82 commented Dec 10, 2019

Yes. it works after changing subscription with channel: beta. Thanks @ecordell for your help.

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