Bug 2150364

Summary: Deletion of VM deletes referenced secret
Product: Container Native Virtualization (CNV) Reporter: Dominik Holler <dholler>
Component: User ExperienceAssignee: Ugo Palatucci <upalatuc>
Status: CLOSED ERRATA QA Contact: Guohua Ouyang <gouyang>
Severity: high Docs Contact:
Priority: high    
Version: 4.11.1CC: gouyang
Target Milestone: ---   
Target Release: 4.13.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-18 02:55:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dominik Holler 2022-12-02 17:19:21 UTC
Description of problem: The Edit Authorized SSH Key adds an owner reference to an existing secret, and the existing secret is deleted durng the VM deletion. 


Version-Release number of selected component (if applicable):
4.11

How reproducible:
100%

Steps to Reproduce:
1. Quick create VirtualMachine but not start after creation
2. Edit Authorized SSH Key in Scripts tab of the previously created VM 
3. Attach a previously created existing secret.
4. Delete VM


Actual results:
Step 3 sets the owner reference of the secret to the VM, and step 4 deletes the secret.

Expected results:
Only secrets created by the Edit Authorized SSH Key dialog are deleted during VM deletion. 

Additional info:

Comment 1 Guohua Ouyang 2022-12-05 02:13:20 UTC
The issue happens on 4.12 as well:
1. the issue is not happened if attaching an existing secret in VM scripts tab during VM creation
2. the issue is happened by attaching an existing secret in VM scripts tab after the VM is created

Comment 5 errata-xmlrpc 2023-05-18 02:55:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Virtualization 4.13.0 Images security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:3205