From c4cf2d86d7853531936f2933a9bdadca58cbf787 Mon Sep 17 00:00:00 2001 From: mitchell Date: Mon, 16 Oct 2023 14:24:54 -0400 Subject: [PATCH] Executor messaging error checks should only fail on our CI, not generic CI. --- cmd/state-exec/condition.go | 6 +++--- cmd/state-exec/main.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/state-exec/condition.go b/cmd/state-exec/condition.go index 74649a66d9..29ed298a2d 100644 --- a/cmd/state-exec/condition.go +++ b/cmd/state-exec/condition.go @@ -2,7 +2,7 @@ package main import "os" -// onCI is copied from the internal/condition package (to minimize depdencies). -func onCI() bool { - return os.Getenv("CI") != "" || os.Getenv("BUILDER_OUTPUT") != "" +// inActiveStateCI is copied from the internal/condition package (to minimize dependencies). +func inActiveStateCI() bool { + return os.Getenv("ACTIVESTATE_CI") == "true" } diff --git a/cmd/state-exec/main.go b/cmd/state-exec/main.go index 5f1842f9c9..a8853b63fd 100644 --- a/cmd/state-exec/main.go +++ b/cmd/state-exec/main.go @@ -87,7 +87,7 @@ func run() error { if err := sendMsgToService(meta.SockPath, hb); err != nil { logr.Debug(" sock - error: %v", err) - if onCI() { // halt control flow on CI only + if inActiveStateCI() { // halt control flow on CI only return fmt.Errorf("cannot send message to service (this error is handled in CI only): %w", err) } } @@ -108,7 +108,7 @@ func run() error { if err := sendMsgToService(meta.SockPath, msg); err != nil { logr.Debug(" sock - error: %v", err) - if onCI() { // halt control flow on CI only + if inActiveStateCI() { // halt control flow on CI only return fmt.Errorf("cannot send message to service (this error is handled in CI only): %w", err) } }