Skip to content

Commit

Permalink
Executor messaging error checks should only fail on our CI, not gener…
Browse files Browse the repository at this point in the history
…ic CI.
  • Loading branch information
mitchell-as committed Oct 16, 2023
1 parent faebd57 commit c4cf2d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cmd/state-exec/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
4 changes: 2 additions & 2 deletions cmd/state-exec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand All @@ -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)
}
}
Expand Down

0 comments on commit c4cf2d8

Please sign in to comment.