Skip to content

Deleting the Console CR removed underlying PVC #30

@ctrought

Description

@ctrought

Describe the bug

More of an undesirable behaviour, but when deleting the CR for an existing console the underlying PVCs are deleted. This behaviour can vary by operator, so if it is deleted with the assumption the PVC can be reused when redeploying the console CR then all data is unknowingly wiped and all configuration and data is lost.

https://sdk.operatorframework.io/docs/building-operators/golang/advanced-topics/#sensitive-resources

Expected behavior

Retain PVC's and require manual cleanup, the PVC will be reused unless user deletes it manually.

Current behavior

PVC is deleted when the console CR is removed.

Possible solution

Do not set ownerReferences on the PVC

Steps to reproduce

  1. Delete an existing console CR with the intention of redeploying (e.g. bugs during upgrade process)
  2. PVC is deleted
  3. Redeploy console CR
  4. Data is gone

Context

A number of operator created PVCs do not set ownerReferences so that PVC's are retained so that the criticality of the data kept there is determined by the end user.

Your Environment

  • PCCO Version used: 0.1.1
  • Environment name and version: OpenShift 4.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions