New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1857650: oVirt, fix incorrect template removal condition #3894
Bug 1857650: oVirt, fix incorrect template removal condition #3894
Conversation
We want to remove the cluster template and the VM associated with it when the override variable is not set, meaning when the installer creates the cluster template. If the override env vatiable is set then an existing template is used on the installtion and we don't want to remove it Signed-off-by: Gal-Zaidman <gzaidman@redhat.com>
RemoveTemplate: ok && customImage != "", | ||
// if we have a custom image, don't remove the template, | ||
// otherwise its a per deployment template, destroy it | ||
RemoveTemplate: !ok, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Gal, just curious, why are you inverting ok with not ? IMO, should be just ok.
Example of RemoveTemplate usage:
installer/pkg/destroy/ovirt/destroyer.go
Line 125 in c91e656
if uninstaller.Metadata.Ovirt.RemoveTemplate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Douglas, I think it's correct what this PR is doing.
If you have a custom image, you have the OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE
defined in your env (the lookup ok
variable is true) and, according to the code comment, we don't wont to remove the template in case the user has a custom image.
Otherwise the ok
will be false so we need to set RemoveTemplate to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly,
OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE is present --> ok = True --> RemoveTemplate = False --> 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 --> ok = False --> RemoveTemplate = True --> Template will be removed and that is what we want because that is a template the installation created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification guy. Looks sane to me too :)
/lgtm |
@Gal-Zaidman: This pull request references Bugzilla bug 1857650, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/bugzilla refresh |
@Gal-Zaidman: This pull request references Bugzilla bug 1857650, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dougsland The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/hold holding until we finish testing |
/test e2e-ovirt |
1 similar comment
/test e2e-ovirt |
Please don't retest until #3897 is merged |
/test e2e-ovirt |
ci/prow/e2e-ovirt — Job succeeded. |
/unhold |
@Gal-Zaidman: All pull requests linked via external trackers have merged: openshift/installer#3894. Bugzilla bug 1857650 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
We want to remove the cluster template and the VM associated with it
when the overriding variable is not set, meaning when the installer
creates the cluster template.
If the override env variable is set then an existing template is used
on the installation and we don't want to remove it
Signed-off-by: Gal-Zaidman gzaidman@redhat.com