Tim Hockin
ff156800a0
Set repoReady even when there wasn't a 1st clone
...
E.g. if the repo is already present (after a restart).
2022-02-12 17:35:04 -08:00
Kubernetes Prow Robot
53b4dbd00d
Merge pull request #490 from thockin/release-3.x
...
Set $GITSYNC_HASH in exechook (v3)
2022-02-06 23:41:43 -08:00
Tim Hockin
32e0d53b33
Set $GITSYNC_HASH in exechook
2022-02-06 16:26:04 -08:00
Kubernetes Prow Robot
83b5d64e26
Merge pull request #483 from thockin/release-3.x
...
Bump to go 1.17
2022-01-31 01:46:24 -08:00
Tim Hockin
8f46cbbb51
Bump go.mod to 1.17
...
run `go mod tidy` and `go mod vendor`
2022-01-28 20:10:20 -08:00
Tim Hockin
a2f4f2446e
Bump go to 1.17
2022-01-28 20:05:50 -08:00
Tim Hockin
76654434f2
Fix bug caused in previous PR
...
The .git to check is not the root/.git but the link/.git - tests pass
now.
2022-01-24 11:01:26 -08:00
Kubernetes Prow Robot
0ce336f03c
Merge pull request #477 from thockin/v3-link-abspath
...
Allow --dest to be an absolute path (v3)
2022-01-23 02:37:56 -08:00
Kubernetes Prow Robot
c0aa9f675d
Merge pull request #475 from thockin/v3-double-register-hook-metric
...
Don't double-register the hook metric (v3)
2022-01-23 01:17:56 -08:00
Kubernetes Prow Robot
bf112d08d8
Merge pull request #473 from thockin/release-3.x
...
Don't try to remove the root if it appears corrupt (v3)
2022-01-23 01:11:56 -08:00
Tim Hockin
ce8c4d38e0
Allow --dest to be an absolute path
...
This means it might live outside of --root.
2022-01-22 23:26:36 -08:00
Tim Hockin
cbf8b896a3
Don't double-register the hook metric
2022-01-22 14:25:24 -08:00
Tim Hockin
fb895f2c12
Don't try to remove the root if it appears corrupt
...
The `--root` is often a volume and can't be removed. Instead, remove
the contents of it. Adjust tests to hit this.
2022-01-22 12:47:19 -08:00
Tim Hockin
d88ae88b34
Fix e2e, dropped 'finish()' func
2022-01-21 20:24:09 -08:00
Kubernetes Prow Robot
a385492d63
Merge pull request #469 from thockin/release-3.x
...
Ensure web/exec hooks complete in --one-time
2022-01-20 04:15:51 -08:00
Tim Hockin
89b0bd5448
Ensure web/exec hooks complete in --one-time
...
Also some small e2e cleanups. This is a port from master branch.
2022-01-19 12:01:15 -08:00
Kubernetes Prow Robot
890531f7b0
Merge pull request #464 from nan-yu/release-3.x
...
Expose the ssh diagnostic message
2022-01-06 16:26:30 -08:00
Nan Yu
ad7f801609
Expose the ssh diagnostic message
...
When git-sync fails to clone the git project, the ssh diagnostic message
is suppressed. It is sometimes helpful for debugging the cloning issue.
One example of the ssh dianostic message is
```
ssh: Could not resolve hostname ${REPO_HOST}: Name or service not known
```
This commit removes the `-q` flag from the ssh command to expose such
message.
2022-01-06 16:12:06 -08:00
Mac Chaffee
0f1ed5e8e6
Avoid writing to /etc/passwd unless needed ( #461 )
...
* Avoid writing to /etc/password unless needed
Signed-off-by: Mac Chaffee <me@macchaffee.com>
* Use user.LookupId to check /etc/passwd
Signed-off-by: Mac Chaffee <me@macchaffee.com>
* Remove unused variables
Signed-off-by: Mac Chaffee <me@macchaffee.com>
2021-12-23 09:22:37 -08:00
Kubernetes Prow Robot
dc324f4283
Merge pull request #454 from yedamao/release-3.x
...
fix typo
2021-11-24 11:03:32 -08:00
yedamo
a7acf14da7
fix typo
2021-11-20 13:08:19 +08:00
Tim Hockin
aceea84578
E2E: build IFF running tests
2021-10-18 09:38:06 -07:00
Tim Hockin
fb9dd2d730
E2E: Add whitespace for reading
2021-10-18 09:38:06 -07:00
Tim Hockin
d190159438
E2E: Rename test funcs
2021-10-18 09:38:06 -07:00
Tim Hockin
dbd0b47635
E2E: make all test cases be funcs
...
Make all test cases functions so they can be called individually on the
CLI. Call test_e2e.sh with `-?` to list tests. Fix related crashes
2021-10-18 09:38:06 -07:00
Tim Hockin
e1ea155f92
E2E: Make SIGINT handling more complete
2021-10-18 09:38:06 -07:00
Tim Hockin
470d70bb42
E2E: Use vars for branch names
2021-10-18 09:38:06 -07:00
Tim Hockin
62830c2a19
E2E: always use '[[ ]]'
2021-10-18 09:38:06 -07:00
Tim Hockin
722ad23e60
Fix e2e cases to not destroy logs
2021-10-18 09:38:06 -07:00
and-1
cca5a5e917
Fix password-file flag declaration
2021-10-12 21:38:25 -07:00
Kubernetes Prow Robot
26c61968d3
Merge pull request #445 from natbaker/use_hash_for_worktree
...
use branch revision during worktree add
2021-10-04 15:29:43 -07:00
Natalie Baker
2c3bb035f6
Use hash for branch when adding a new worktree
2021-10-04 16:55:32 -04:00
Kubernetes Prow Robot
f52e17ea2c
Merge pull request #442 from thockin/release-3.x
...
Port small fixes from v4 branch
2021-08-18 08:44:08 -07:00
Tim Hockin
9835c219d0
Fix env var names
2021-08-17 08:26:59 -07:00
Tim Hockin
44306c0dd8
Rename exechook receivers
2021-08-16 23:45:48 -07:00
Tim Hockin
2d3ccf6026
Add one call depth to compensate for log pkg
2021-08-16 23:43:47 -07:00
Kubernetes Prow Robot
a510b67602
Merge pull request #437 from eminugurkenar/release-3.x
...
Add syncHookCommand error metric
2021-08-16 12:44:23 -07:00
ugurkenar
df69fab365
cmd,hook and logging package
2021-08-16 12:40:27 +03:00
Kubernetes Prow Robot
5fcf46aee4
Merge pull request #435 from thockin/release-3.x
...
Add option to read passwd from file (v3 branch)
2021-07-06 04:24:21 -07:00
Tim Hockin
2a81ea69f0
Add option to read passwd from file
...
This is a port of #431 .
A new flag `--password-file` is added. This allows git-sync to read
password from file and this is considered as safer than reading from
env or flag directly.
Few more checks are added as well:
1. `--password` and `--password-file` can't be specified at the same
time.
2. If `--username` is specified, then one of `--password` or
`--password-file` must be specified.
2021-07-05 15:49:18 -07:00
Kubernetes Prow Robot
259f7d8000
Merge pull request #432 from amccague/patch-1
...
Update to latest base image debian-base:buster-v1.8.0
2021-06-30 17:15:54 -07:00
Adrian McCague
d1a773f818
Update Makefile
...
Use the latest promoted debian base image: https://github.com/kubernetes/k8s.io/pull/2256
Overcomes 2 critical vulnerabilities:
* https://nvd.nist.gov/vuln/detail/CVE-2021-20231
* https://nvd.nist.gov/vuln/detail/CVE-2021-20232
My organisation cares about published and fixed vulnerabilities and we use this tool extensively, thank you for it :)
2021-06-30 13:37:04 +01:00
Kubernetes Prow Robot
fc7162b321
Merge pull request #426 from thockin/release-3.x
...
Update RELEASING doc
2021-06-24 10:17:41 -07:00
Tim Hockin
9bc9565cb2
Update RELEASING doc
2021-06-24 09:01:29 -07:00
Kubernetes Prow Robot
3dc0c235f5
Merge pull request #419 from thockin/release-3.x
...
Add Janet and Nan as approvers (3.x)
2021-06-24 05:35:41 -07:00
Kubernetes Prow Robot
a5ee1b12f5
Merge pull request #413 from barney-s/412
...
Check for rev to be present after a fetch
2021-06-23 12:04:10 -07:00
barney-s
6baccb4c5d
Check for rev to be present after a fetch
...
When we fetch expecting a rev/hash to be present, defensively check and fail gracefully so that a subsequent sync would get it. Check for missing hash after a git fetch with shallow depth
2021-06-23 14:56:39 -04:00
Tim Hockin
6a6a0d0473
Add Janet and Nan as approvers
...
They are using git-sync and have had a bunch of ideas for improvements.
I have had a hard time finding enough time to devote to this and they
offered to help.
2021-06-23 09:57:02 -07:00
Kubernetes Prow Robot
9cd1e24966
Merge pull request #414 from barney-s/411
...
Cleanup worktree defensively
2021-06-22 14:36:10 -07:00
barney-s
fe9c059828
Cleanup worktree defensively
...
This is to avoid wedge cases where the worktree was created but this function error'd without cleaning the worktree.
Next timearound, the sync loop fails to create the worktree and bails out.
We observed a case where due to #412 , the next sync loop failed with this error:
" Run(git worktree add /repo/root/rev-nnnn origin/develop): exit status 128: { stdout: \"Preparing worktree (detached HEAD nnnn)\\n\", stderr: \"fatal: '/repo/root/rev-nnnn' already exists\\n\" }"
2021-06-22 16:40:58 -04:00