From a96ff59cd9baff77a857c3b0d966c9d8426d383b Mon Sep 17 00:00:00 2001 From: Andrey Velichkevich Date: Sat, 7 Nov 2020 02:57:37 +0000 Subject: [PATCH] Fix: Add taskruns to Katib controller role to run Tekton Pipelines (#1380) * Add taskruns to controller role * Condition in one line --- manifests/v1beta1/katib-controller/rbac.yaml | 1 + pkg/webhook/v1beta1/pod/inject_webhook.go | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/v1beta1/katib-controller/rbac.yaml b/manifests/v1beta1/katib-controller/rbac.yaml index c52c3c3d7fc..683029ba987 100644 --- a/manifests/v1beta1/katib-controller/rbac.yaml +++ b/manifests/v1beta1/katib-controller/rbac.yaml @@ -77,6 +77,7 @@ rules: - tekton.dev resources: - pipelineruns + - taskruns verbs: - "*" - apiGroups: diff --git a/pkg/webhook/v1beta1/pod/inject_webhook.go b/pkg/webhook/v1beta1/pod/inject_webhook.go index cbbd471898a..a32f83a018e 100644 --- a/pkg/webhook/v1beta1/pod/inject_webhook.go +++ b/pkg/webhook/v1beta1/pod/inject_webhook.go @@ -70,11 +70,10 @@ func (s *sidecarInjector) Handle(ctx context.Context, req types.Request) types.R // Check whether the pod need to be mutated needMutate, err := s.MutationRequired(pod, namespace) if err != nil { + log.Info("Unable to run MutationRequired", "Error", err) return admission.ErrorResponse(http.StatusInternalServerError, err) - } else { - if !needMutate { - return admission.ValidationResponse(true, "") - } + } else if !needMutate { + return admission.ValidationResponse(true, "") } // Do mutation