diff options
| author | Xe <xe@tailscale.com> | 2022-07-22 15:14:39 -0400 |
|---|---|---|
| committer | Xe <xe@tailscale.com> | 2022-07-22 15:14:39 -0400 |
| commit | 2716667c9d9e21b301ec8a6f3e599b4a95468e0e (patch) | |
| tree | 58fc6b537ee73a60b92a6fadb6bfd6457664d00e /cmd/gitops-pusher/gitops-pusher.go | |
| parent | affa25097c8c6d439b3448bafc8133fd5fbd29d0 (diff) | |
| download | tailscale-Xe/gitops-pusher-three-version-problem.tar.xz tailscale-Xe/gitops-pusher-three-version-problem.zip | |
cmd/gitops-pusher: things i forgot to push last PRXe/gitops-pusher-three-version-problem
Signed-off-by: Xe <xe@tailscale.com>
Diffstat (limited to 'cmd/gitops-pusher/gitops-pusher.go')
| -rw-r--r-- | cmd/gitops-pusher/gitops-pusher.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/gitops-pusher/gitops-pusher.go b/cmd/gitops-pusher/gitops-pusher.go index 59c7ffe21..ea907ae9e 100644 --- a/cmd/gitops-pusher/gitops-pusher.go +++ b/cmd/gitops-pusher/gitops-pusher.go @@ -57,7 +57,7 @@ func apply(cache *Cache, tailnet, apiKey string) func(context.Context, []string) if cache.PrevETag == "" { log.Println("no previous etag found, assuming local file is correct and recording that") - cache.PrevETag = Shuck(localEtag) + cache.PrevETag = localEtag } log.Printf("control: %s", controlEtag) @@ -69,6 +69,7 @@ func apply(cache *Cache, tailnet, apiKey string) func(context.Context, []string) } if controlEtag == localEtag { + cache.PrevETag = localEtag log.Println("no update needed, doing nothing") return nil } @@ -77,7 +78,7 @@ func apply(cache *Cache, tailnet, apiKey string) func(context.Context, []string) return err } - cache.PrevETag = Shuck(localEtag) + cache.PrevETag = localEtag return nil } @@ -97,7 +98,7 @@ func test(cache *Cache, tailnet, apiKey string) func(context.Context, []string) if cache.PrevETag == "" { log.Println("no previous etag found, assuming local file is correct and recording that") - cache.PrevETag = Shuck(localEtag) + cache.PrevETag = localEtag } log.Printf("control: %s", controlEtag) @@ -246,7 +247,7 @@ func applyNewACL(ctx context.Context, tailnet, apiKey, policyFname, oldEtag stri req.SetBasicAuth(apiKey, "") req.Header.Set("Content-Type", "application/hujson") - req.Header.Set("If-Match", oldEtag) + req.Header.Set("If-Match", `"`+oldEtag+`"`) resp, err := http.DefaultClient.Do(req) if err != nil { |
