From 122bd667dcfd35a1a218a1f490d21347e06aa08e Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Tue, 30 Aug 2022 09:41:25 -0400 Subject: [PATCH] cmd/gitops-pusher: be less paranoid about external modifications (#5488) This makes a "modified externally" error turn into a "modified externally" warning. It means CI won't fail if someone does something manually in the admin console. Signed-off-by: Xe --- cmd/gitops-pusher/gitops-pusher.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cmd/gitops-pusher/gitops-pusher.go b/cmd/gitops-pusher/gitops-pusher.go index f8748d679..ebdd69eaa 100644 --- a/cmd/gitops-pusher/gitops-pusher.go +++ b/cmd/gitops-pusher/gitops-pusher.go @@ -30,17 +30,14 @@ var ( cacheFname = rootFlagSet.String("cache-file", "./version-cache.json", "filename for the previous known version hash") timeout = rootFlagSet.Duration("timeout", 5*time.Minute, "timeout for the entire CI run") githubSyntax = rootFlagSet.Bool("github-syntax", true, "use GitHub Action error syntax (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)") - - modifiedExternallyFailure = make(chan struct{}, 1) ) func modifiedExternallyError() { if *githubSyntax { - fmt.Printf("::error file=%s,line=1,col=1,title=Policy File Modified Externally::The policy file was modified externally in the admin console.\n", *policyFname) + fmt.Printf("::warning file=%s,line=1,col=1,title=Policy File Modified Externally::The policy file was modified externally in the admin console.\n", *policyFname) } else { fmt.Printf("The policy file was modified externally in the admin console.\n") } - modifiedExternallyFailure <- struct{}{} } func apply(cache *Cache, tailnet, apiKey string) func(context.Context, []string) error { @@ -207,10 +204,6 @@ func main() { fmt.Println(err) os.Exit(1) } - - if len(modifiedExternallyFailure) != 0 { - os.Exit(1) - } } func sumFile(fname string) (string, error) {