Skip to content

Detect pre-existing operator Subscription before creating ManifestWork #90

Description

@mkolesnik

The controller creates the operator ManifestWork unconditionally.
If a Subscription with the same name already exists on the spoke (e.g. installed manually or by another component), ManifestWork will claim ownership of it.
Deleting the mesh would then remove that pre-existing Subscription, breaking whatever depended on it.

A known case: on OCP <4.22, the ingress operator installs OSSM via a servicemeshoperator3 Subscription in openshift-operators.
Since we use the same Subscription name and namespace for OCP clusters, our ManifestWork would hijack it.
This could disrupt the ingress operator's functionality if the mesh is later deleted.

We should use a ManagedClusterView to check for an existing Subscription before creating the ManifestWork.
If no Subscription is found, proceed with ManifestWork creation as usual.
If an incompatible Subscription is found (different channel, catalog source, etc.), report a conflict status and halt reconciliation for that cluster.

If a compatible Subscription is found, the controller should "adopt" it by skipping ManifestWork creation entirely.
The operator is already installed and working, so we just need to track that it exists and move on to the next reconciliation steps (trust, discovery).
Cleanup should also be aware of adoption: when the mesh is deleted, the controller should not attempt to remove an adopted operator since it didn't install it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    operatorInstalling 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