From 129c67d68ee2db4aa3a45ab6970e7d26348ce5ef Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Wed, 25 Sep 2019 14:31:40 -0700 Subject: Fix runsc log collection in kokoro PiperOrigin-RevId: 271207152 --- runsc/sandbox/sandbox.go | 2 +- scripts/common_bazel.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runsc/sandbox/sandbox.go b/runsc/sandbox/sandbox.go index 4c6c83fbd..ee9327fc8 100644 --- a/runsc/sandbox/sandbox.go +++ b/runsc/sandbox/sandbox.go @@ -352,7 +352,7 @@ func (s *Sandbox) createSandboxProcess(conf *boot.Config, args *Args, startSyncF } if conf.DebugLog != "" { test := "" - if len(conf.TestOnlyTestNameEnv) == 0 { + if len(conf.TestOnlyTestNameEnv) != 0 { // Fetch test name if one is provided and the test only flag was set. if t, ok := specutils.EnvVar(args.Spec.Process.Env, conf.TestOnlyTestNameEnv); ok { test = t diff --git a/scripts/common_bazel.sh b/scripts/common_bazel.sh index dde0b51ed..ea2291a4d 100755 --- a/scripts/common_bazel.sh +++ b/scripts/common_bazel.sh @@ -80,7 +80,7 @@ function collect_logs() { # Collect sentry logs, if any. if [[ -v RUNSC_LOGS_DIR ]] && [[ -d "${RUNSC_LOGS_DIR}" ]]; then local -r logs=$(ls "${RUNSC_LOGS_DIR}") - if [[ -z "${logs}" ]]; then + if [[ "${logs}" ]]; then tar --create --gzip --file="${KOKORO_ARTIFACTS_DIR}/${RUNTIME}.tar.gz" -C "${RUNSC_LOGS_DIR}" . fi fi -- cgit v1.2.3