Skip to content

Installation of an Operator fails when BundleDeployment with the same bundle already exists #443

Description

@m1kola

Steps to reproduce:

  1. Create a catalog on cluster: kubectl apply -f config/samples/catalogd_operatorcatalog.yaml
  2. Create a BundleDeployment:
apiVersion: core.rukpak.io/v1alpha1kind: BundleDeploymentmetadata:
name: operator-sample-manualspec:
provisionerClassName: core-rukpak-io-plaintemplate:
metadata: {}spec:
provisionerClassName: core-rukpak-io-registrysource:
image:
ref: quay.io/operatorhubio/argocd-operator@sha256:1a9b3c8072f2d7f4d6528fa32905634d97b7b4c239ef9887e3fb821ff033fef6type: image
  1. Create an Operator which resolves to the same bundle:
apiVersion: operators.operatorframework.io/v1alpha1kind: Operatormetadata:
labels:
app.kubernetes.io/name: operatorapp.kubernetes.io/instance: operator-sampleapp.kubernetes.io/part-of: operator-controllerapp.kubernetes.io/managed-by: kustomizeapp.kubernetes.io/created-by: operator-controllername: operator-samplespec:
packageName: argocd-operatorversion: 0.6.0

Actual result:

apiVersion: operators.operatorframework.io/v1alpha1kind: Operatormetadata:
# ...name: operator-samplespec:
# ...status:
conditions:
- lastTransitionTime: "2023-10-06T12:26:51Z"message: resolved to "quay.io/operatorhubio/argocd-operator@sha256:1a9b3c8072f2d7f4d6528fa32905634d97b7b4c239ef9887e3fb821ff033fef6"observedGeneration: 1reason: Successstatus: "True"type: Resolved
- lastTransitionTime: "2023-10-06T12:26:57Z"message: 'bundledeployment not ready: rendered manifests contain a resource that already exists. Unable to continue with install: Namespace "argocd-operator-system" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must equal "operator-sample": current value is "operator-sample-manual"'observedGeneration: 1reason: InstallationFailedstatus: "False"type: InstalledresolvedBundleResource: quay.io/operatorhubio/argocd-operator@sha256:1a9b3c8072f2d7f4d6528fa32905634d97b7b4c239ef9887e3fb821ff033fef6

Expected result:

Not sure what would be the expected behaviour in here. Perhaps a better error message indicating conflict. Or, if we can successfully resolve, updating ownerReferences on already existing BundleDeployment instead of creating a new one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions