For cases where users want to be extra careful about not overwriting
manual changes, add a flag to hard-fail. This is only useful if the etag
cache is persistent or otherwise reliable. This flag should not be used
in ephemeral CI workers that won't persist the cache.
Updates https://github.com/tailscale/corp/issues/22177
Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
apiServer=rootFlagSet.String("api-server","api.tailscale.com","API server to contact")
failOnManualEdits=rootFlagSet.Bool("fail-on-manual-edits",false,"fail if manual edits to the ACLs in the admin panel are detected; when set to false (the default) only a warning is printed")
)
funcmodifiedExternallyError(){
funcmodifiedExternallyError()error{
if*githubSyntax{
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)
returnfmt.Errorf("::warning file=%s,line=1,col=1,title=Policy File Modified Externally::The policy file was modified externally in the admin console.",*policyFname)
}else{
fmt.Printf("The policy file was modified externally in the admin console.\n")
returnfmt.Errorf("The policy file was modified externally in the admin console.")