From 2ad5a13f9ffce8fcc1c829eafbae7c99fe4ac336 Mon Sep 17 00:00:00 2001 From: Nikolaos Moraitis Date: Fri, 26 Oct 2018 09:30:01 +0200 Subject: [PATCH] remove deprecated annotation --- TEMPLATES.md | 4 ---- pkg/steps/template.go | 15 +++++---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/TEMPLATES.md b/TEMPLATES.md index e8749c14..eece814b 100644 --- a/TEMPLATES.md +++ b/TEMPLATES.md @@ -108,10 +108,6 @@ overall result of the job. Comma-separated list of container names for which ci-operator will wait until complete, to gather the artifacts. -`ci-operator.openshift.io/always-show-output`: -Will output the logs of all the containers in the pod, no matter what the exit code was. -The value should be `true` to enable this feature. - `ci-operator.openshift.io/containers-logged-on-failure`: Comma-separated list of container names for which ci-operator will collect and log their output if pod fails. By default, only the logs from the failed containers will be output. \ No newline at end of file diff --git a/pkg/steps/template.go b/pkg/steps/template.go index 19a322a8..ff9978f3 100644 --- a/pkg/steps/template.go +++ b/pkg/steps/template.go @@ -38,7 +38,6 @@ type templateExecutionStep struct { } const ( - showOutputAnnotation string = "ci-operator.openshift.io/always-show-output" showContainerOutputAnnotation string = "ci-operator.openshift.io/containers-logged-on-failure" ) @@ -593,10 +592,8 @@ func waitForPodCompletionOrTimeout(podClient coreclientset.PodInterface, name st return false, nil } if podJobIsFailed(pod) { - if pod.ObjectMeta.Annotations[showOutputAnnotation] != "true" { - if err := outputAnnotatedContainerLogs(podClient, pod); err != nil { - log.Printf("%v", err) - } + if err := outputAnnotatedContainerLogs(podClient, pod); err != nil { + log.Printf("%v", err) } return false, appendLogToError(fmt.Errorf("the pod %s/%s failed after %s (failed containers: %s): %s", pod.Namespace, pod.Name, podDuration(pod).Truncate(time.Second), strings.Join(failedContainerNames(pod), ", "), podReason(pod)), podMessages(pod)) } @@ -623,10 +620,8 @@ func waitForPodCompletionOrTimeout(podClient coreclientset.PodInterface, name st return false, nil } if podJobIsFailed(pod) { - if pod.ObjectMeta.Annotations[showOutputAnnotation] != "true" { - if err := outputAnnotatedContainerLogs(podClient, pod); err != nil { - log.Printf("%v", err) - } + if err := outputAnnotatedContainerLogs(podClient, pod); err != nil { + log.Printf("%v", err) } return false, appendLogToError(fmt.Errorf("the pod %s/%s failed after %s (failed containers: %s): %s", pod.Namespace, pod.Name, podDuration(pod).Truncate(time.Second), strings.Join(failedContainerNames(pod), ", "), podReason(pod)), podMessages(pod)) } @@ -816,7 +811,7 @@ func podLogNewContainers(podClient coreclientset.PodInterface, pod *coreapi.Pod, completed[status.Name] = s.FinishedAt.Time notifier.Notify(pod, status.Name) - if pod.ObjectMeta.Annotations[showOutputAnnotation] != "true" && s.ExitCode == 0 { + if s.ExitCode == 0 { log.Printf("Container %s in pod %s completed successfully", status.Name, pod.Name) continue }