Bug 2152094 - Tekton pipeline fails in delete-template taskrun
Summary: Tekton pipeline fails in delete-template taskrun
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Infrastructure
Version: 4.12.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.12.3
Assignee: Karel Šimon
QA Contact: Geetika Kapoor
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-09 08:02 UTC by Geetika Kapoor
Modified: 2023-05-23 22:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-23 22:31:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt tekton-tasks-operator pull 107 0 None Merged add missing delete template permission to win 10 installer pipeline 2023-05-16 05:59:01 UTC
Red Hat Issue Tracker CNV-23279 0 None None None 2022-12-09 08:36:55 UTC
Red Hat Issue Tracker OCPBUGS-7857 0 None None None 2023-03-21 11:18:33 UTC
Red Hat Product Errata RHEA-2023:3283 0 None None None 2023-05-23 22:31:39 UTC

Description Geetika Kapoor 2022-12-09 08:02:20 UTC
Description of problem:

Tekton pipeline fails in delete-template taskrun if any kind of taskrun failures happen before it.

Error:

2022/12/09 00:56:57 warning: unsuccessful cred copy: ".docker" from "/tekton/creds" to "/": unable to create destination directory: mkdir /.docker: permission denied
panic: templates.template.openshift.io "windows10-desktop-large-installer" is forbidden: User "system:serviceaccount:openshift-cnv:pipeline" cannot delete resource "templates" in API group "template.openshift.io" in the namespace "openshift-cnv" [recovered]
	panic: templates.template.openshift.io "windows10-desktop-large-installer" is forbidden: User "system:serviceaccount:openshift-cnv:pipeline" cannot delete resource "templates" in API group "template.openshift.io" in the namespace "openshift-cnv"

goroutine 1 [running]:
github.com/kubevirt/kubevirt-tekton-tasks/modules/shared/pkg/exit.HandleExit()
	/remote-source/app/modules/modify-vm-template/vendor/github.com/kubevirt/kubevirt-tekton-tasks/modules/shared/pkg/exit/exit.go:80 +0xb4
panic({0xd667c0, 0xc000210ca0})
	/usr/lib/golang/src/runtime/panic.go:884 +0x212
github.com/kubevirt/kubevirt-tekton-tasks/modules/shared/pkg/exit.ExitOrDieFromError(0x3, {0xf5dea0, 0xc000199860?}, {0xc0000cfe5f, 0x1, 0x1?})
	/remote-source/app/modules/modify-vm-template/vendor/github.com/kubevirt/kubevirt-tekton-tasks/modules/shared/pkg/exit/exit.go:60 +0x167
main.main()
	/remote-source/app/modules/modify-vm-template/cmd/modify-vm-template/main.go:41 +0x51a

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

4.12

How reproducible:

always 

Steps to Reproduce:
1. any taskrun before delete-template should fail
2.
3.

Actual results:

delete-template getting impacted with any failures

Expected results:

delete-template should not be impacted with any failures

Additional info:

Comment 4 Geetika Kapoor 2023-02-17 00:26:10 UTC
Test Env:

$ oc get csv -n openshift-cnv
NAME                                       DISPLAY                       VERSION   REPLACES                                   PHASE
kubevirt-hyperconverged-operator.v4.12.1   OpenShift Virtualization      4.12.1    kubevirt-hyperconverged-operator.v4.12.0   Succeeded
openshift-pipelines-operator-rh.v1.9.0     Red Hat OpenShift Pipelines   1.9.0                                                Succeeded


Test Case :

Test Case 1 : Regular run with windows10 en iso image - pipelineref - windows10-installer - and then to check template deletion and vm cleanup
Result : Pipeline is GREEN and all tasks worked.

Test Case 2:  Running Pipeline , cancel/failed in between a clustertask(could be due to network, human intervention)and then to check template deletion and vm cleanup. 
Result :  we see that delete and cleanup tasks are still not started. 
Raised : https://issues.redhat.com/browse/SRVKP-2845

Test case 3: Rerun the Test case 1. Now DV already exist. Monitor the run and see the pipeline status. - pipelineref - windows10-installer
Result : Pipeline is GREEN and all tasks worked.


Test Case 4 : Regular run with - pipelineref - windows10-customize - and then to check template deletion and vm cleanup
Result : Pipeline is GREEN and all tasks worked.

Test Case 5 : Regular run with - pipelineref - windows10-customize with non regular dv name - and then to check template deletion and vm cleanup
Result : Failed as it only want win10 as dv name. This can be use configurable for better usability
Raised : https://bugzilla.redhat.com/show_bug.cgi?id=2170699



Teardown(delete+cleanup) doesn't work if pipeline failed/cancelled.

Comment 8 Geetika Kapoor 2023-05-23 17:15:05 UTC
Moving this bug to verified . All other test cases that needs retesting are track as independent bugs.

Comment 13 errata-xmlrpc 2023-05-23 22:31:22 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 Virtualization 4.12.3 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/RHEA-2023:3283


Note You need to log in before you can comment on or make changes to this bug.