Skip to content

Clean up OLM CSV when deleting operator ManifestWork on OCP #124

Description

@mkolesnik

When targeting OCP clusters with the default namespace (openshift-operators), the operator ManifestWork only contains the Subscription since the namespace and OperatorGroup already exist.
When the ManifestWork is deleted, the work agent deletes the Subscription but OLM does not delete the CSV.
The CSV stays with the operator deployment still running.

If a new mesh is created for the same cluster, the new Subscription fails to resolve:
constraints not satisfiable: @existing/<ns>//<csv> and <catalog>/<channel>/<csv> provide <API>

When using a custom operator namespace, the MW includes the Namespace resource and its deletion cascades to everything inside it.

We need to either explicitly delete the CSV during operator cleanup, or change the OCP default to a dedicated namespace so the MW owns the full lifecycle.

Options:

  • Change the default operator namespace to a dedicated one (e.g. multicluster-mesh-operator) for all platforms. This simplifies the CRD (one default instead of platform-specific defaults) and the controller code (no special-casing for openshift-operators). Tradeoff: on OCP, operators in openshift-operators appear in the console's "Installed Operators" view by default, a custom namespace might require an extra click.
  • Delete the CSV as a separate cleanup step before deleting the operator ManifestWork.
  • Add the CSV to the ManifestWork once its name is known (Report operator installation status via ManifestWork feedback #119). Risk: work agent could fight OLM upgrades.

Related: #115 (simplify operator config)

Ref: https://olm.operatorframework.io/docs/tasks/uninstall-operator/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoperatorInstalling and managing the mesh operator on spokes

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions