Bug 1857650

Summary: [oVirt] incorrect template removal condition
Product: OpenShift Container Platform Reporter: Gal Zaidman <gzaidman>
Component: InstallerAssignee: Gal Zaidman <gzaidman>
Installer sub component: OpenShift on RHV QA Contact: Guilherme Santos <gdeolive>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified    
Version: 4.6   
Target Milestone: ---   
Target Release: 4.6.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: 2020-10-27 16:15:06 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 Gal Zaidman 2020-07-16 09:26:56 UTC
Description of problem:
On oVirt installer we have an incorrect template removal condition.
We need to remove the template only when the env variable OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE is not found and currently is is the other way around.
The expected flows:
OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE is present --> Template will not be removed and that is what we want because that is a template the installation didn't create
OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE is not present --> Template will be removed and that is what we want because that is a template the installation created

Comment 3 Guilherme Santos 2020-07-23 13:35:27 UTC
Verified on:
4.6.0-0.nightly-2020-07-22-074636

Steps:
1. with override of image:
  1.1. have an rhcos template on RHV and export it as env var: 
       # export OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE=rchos-template
  1.2. # openshift-install create cluster --log-level=debug --dir=resources
  1.3. # openshift-install destroy cluster --log-level=debug --dir=resources

2. without override of image:
  2.1. # openshift-install create cluster --log-level=debug --dir=resources
  2.2. # openshift-install destroy cluster --log-level=debug --dir=resources


Results:
on scenario 1. the used template didn't get deleted on destroy
on scenario 2. the created template did get deleted on destroy

Comment 5 errata-xmlrpc 2020-10-27 16:15:06 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 (OpenShift Container Platform 4.6 GA Images), 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/RHBA-2020:4196