Open cmoulliard opened 5 years ago
I have updated the code to change the status to building
when the component will be be processed by the build
reconcile.
As the code that we use is the same between the dev
or build
installation to keep track of the pod status changes, how can I fetch the taskRun/s2i-buildah-push
pod created by tekton to update finally the Component status to Ready
if the build succeed
or fail
? @metacosm
Should we have 2 fetch functions or one where we pass as parameter the deploymentMode and where we change the label to get the taskRun
pod ?
@cmoulliard I think we should have only one function and use the deploymentMode
. That said, that function should probably be changed, since in calling code, we're only interested in the pod status and its name, not the pod itself…
I propose then to enrich the fetch function and to use as label to query the build's pod this selector - https://github.com/snowdrop/component-operator/blob/166030e6bdaabc7d91fe45ca9525564838cff430/pkg/controller/component/helpers.go#L58 and of course the app: component_name
selector for a dev's pod
BTW, we have also to change the code in order to use isPodReady
for dev deployment
and isBuildSucceed
for build deployment
Here are the different status reported by the taskRun
pod. Value is equal to True
if it succeeded
oc get taskruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
s2i-buildah-push Unknown Pending 6s
oc get taskruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
s2i-buildah-push Unknown Building 24s
oc get taskruns
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
s2i-buildah-push False 2m 51s
I can't use fetchPod
to get the pod and next check if isBuildSucceeded
as the status and conditions are managed by the taskRun
resource and not directly by the pod of task doing the build
Description of the problem
We don't change the component status when we use the
Build mode
and when Tekton starts or ends the task of the build