Describe the bug
When pointing flux to a different git repo (and path), flux started reporting "fatal: Invalid revision range" in the log, despite new changes are still applied.
To Reproduce
Steps to reproduce the behaviour:
- --log-format=fmt
- --ssh-keygen-dir=/var/fluxd/keygen
- --k8s-secret-name=flux-git-deploy
- --memcached-hostname=flux-memcached
- --sync-state=git
- --memcached-service=
- --git-url=<repo_1>
- --git-branch=master
- --git-path=cluster_a
- --git-readonly=true
- --git-user=Weave Flux
- [email protected]
- --git-set-author=false
- --git-poll-interval=5m
- --git-timeout=20s
- --sync-interval=5m
- --git-ci-skip=false
- --manifest-generation=true
- --registry-poll-interval=5m
- --registry-rps=200
- --registry-burst=125
- --registry-trace=false
- --sync-garbage-collection=true
<repo_1>/cluster_a to <repo_2>/k8s/cluster_aExpected behavior
Flux does not throw errors. (I think flux might be tracking the git commit hash of the last applied commit and can't find it anymore since we moved the config from a dedicated test repo to the main production monorepo, and flux can no longer find the same git commit that was last applied. But is there a way to stop it from complaining in the log?)
Logs
➜ k -n flux logs -f flux-59b79b7d88-7r5df
Flag --registry-poll-interval has been deprecated, changed to --automation-interval, use that instead
ts=2019-10-29T17:30:56.386651072Z caller=main.go:248 version=1.15.0
ts=2019-10-29T17:30:56.386716594Z caller=main.go:273 warning="--git-readonly prevents use of --sync-state=git. Forcing to --sync-state=secret"
ts=2019-10-29T17:30:56.386747083Z caller=main.go:292 warning="configuring any of {git-user, git-email, git-set-author, git-ci-skip} has no effect when --git-readonly is set"
ts=2019-10-29T17:30:56.386784976Z caller=main.go:383 msg="using in cluster config to connect to the cluster"
ts=2019-10-29T17:30:56.414333147Z caller=main.go:468 component=cluster identity=/etc/fluxd/ssh/identity
ts=2019-10-29T17:30:56.414735322Z caller=main.go:469 component=cluster identity.pub="ssh-rsa <REDACTED>"
ts=2019-10-29T17:30:56.414797738Z caller=main.go:474 host=https://10.233.0.1:443 version=kubernetes-v1.14.5
ts=2019-10-29T17:30:56.414879938Z caller=main.go:486 kubectl=/usr/local/bin/kubectl
ts=2019-10-29T17:30:56.416120615Z caller=main.go:498 ping=true
ts=2019-10-29T17:30:56.421422894Z caller=main.go:633 url=ssh://[email protected]:7999/infra/infra.git user="Weave Flux" [email protected] signing-key= verify-signatures=false sync-tag=flux-sync state=secret readonly=true notes-ref=flux set-author=false git-secret=false
ts=2019-10-29T17:30:56.422425408Z caller=main.go:736 upstream="no upstream URL given"
ts=2019-10-29T17:30:56.424032112Z caller=main.go:757 addr=:3030
ts=2019-10-29T17:30:56.428383619Z caller=loop.go:60 component=sync-loop info="Repo is read-only; no image updates will be attempted"
ts=2019-10-29T17:30:56.428448661Z caller=loop.go:101 component=sync-loop err="git repo not ready: git repo has not been cloned yet"
ts=2019-10-29T17:31:09.139850187Z caller=loop.go:127 component=sync-loop event=refreshed url=<REDACTED> branch=master HEAD=cc2c9db7709819ce702f5f68a06626c9eafa91cb
ts=2019-10-29T17:31:10.667017783Z caller=loop.go:101 component=sync-loop err="fatal: Invalid revision range 6a682263cddd53bfe3bff007b9cd054fbeeea345..cc2c9db7709819ce702f5f68a06626c9eafa91cb, full output:\n fatal: Invalid revision range 6a682263cddd53bfe3bff007b9cd054fbeeea345..cc2c9db7709819ce702f5f68a06626c9eafa91cb\n"
Additional context
Add any other context about the problem here, e.g
@javefang removing the commit reference from the secret Flux creates in read-only mode to keep track of state should resolve this.
Thank you @hiddeco ! Setting --state-sync=secret and removing the annotation that keep track of the commit hash fixed it!
as @hiddeco state, removing the annotation helps resolve the issue.
you are probably looking for something like flux.weave.works/sync-hwm:
@johnrkriter Thank you for specifying the flux.weave.works/sync-hwm annotation. That helped me resolve this issue for my app.