Skip to content

Commit 122bd66

Browse files
author
Xe Iaso
authored
cmd/gitops-pusher: be less paranoid about external modifications (tailscale#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 <xe@tailscale.com>
1 parent 21cd402 commit 122bd66

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

cmd/gitops-pusher/gitops-pusher.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@ var (
3030
cacheFname = rootFlagSet.String("cache-file", "./version-cache.json", "filename for the previous known version hash")
3131
timeout = rootFlagSet.Duration("timeout", 5*time.Minute, "timeout for the entire CI run")
3232
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)")
33-
34-
modifiedExternallyFailure = make(chan struct{}, 1)
3533
)
3634

3735
func modifiedExternallyError() {
3836
if *githubSyntax {
39-
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)
37+
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)
4038
} else {
4139
fmt.Printf("The policy file was modified externally in the admin console.\n")
4240
}
43-
modifiedExternallyFailure <- struct{}{}
4441
}
4542

4643
func apply(cache *Cache, tailnet, apiKey string) func(context.Context, []string) error {
@@ -207,10 +204,6 @@ func main() {
207204
fmt.Println(err)
208205
os.Exit(1)
209206
}
210-
211-
if len(modifiedExternallyFailure) != 0 {
212-
os.Exit(1)
213-
}
214207
}
215208

216209
func sumFile(fname string) (string, error) {

0 commit comments

Comments
 (0)