Current Behavior:
The secret gets deleted:
- If retainResourcesOnCompletion flag is unset or set to false and the must-gather job fails
- If retainResourcesOnCompletion flag is unset or set to false and the must-gather job succeeds
- If deletionTimestamp is set on CR and retainResourcesOnCompletion flag is unset or set to false
The secret does not get deleted:
- If retainResourcesOnCompletion flag is set to true
- If user deletes the CR manually (secret remains preserved because of no owner ref)
Expected behavior:
Delete the Secret only if the operator had created it i.e.
- if retainResourcesOnCompletion: false
delete only if Secret was copied from some-other-namespace to the operator namespace as a result of the secret copying - if retainResourcesOnCompletion: true
do not delete during cleanup, but add an ownerReference to our CR for the copied secret - do nothing with the Secret (in terms of cleanup/ownerReference) when Secret and CR are both in the operator namespace.
Acceptance criteria:
Secret lifecycle should be maintained as per the expected behavior
There are no Sub-Tasks for this issue.