Commit Graph

448 Commits

Author SHA1 Message Date
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
Tim Hockin 80a9d54ae0 unbreak e2e for github 2021-06-22 08:28:59 -07:00
Kubernetes Prow Robot f85a52d0a0
Merge pull request #405 from thockin/release-3.x
bump to logr v1.0.0-rc1
2021-06-16 14:08:00 -07:00
Kubernetes Prow Robot 921bd812d6
Merge pull request #408 from briantkennedy/rel
Improve error message for askpass.
2021-06-15 14:13:43 -07:00
Brian Kennedy edb3f08ec0 Improve error message for askpass.
When endpoint returns non-200 status, include the body in the error
message since it can contain useful information for debugging.  Also
defer closing the response body ReadCloser as this may have leaked in
the past.
2021-06-15 13:38:01 -07:00
Tim Hockin 8904c30ce9 bump to logr v1.0.0-rc1 2021-06-13 10:57:37 -07:00
Tim Hockin 2abd898038 Update README to spec UID/GID 2021-06-04 15:59:36 -07:00
Tim Hockin 3369339a32 Change libcurl workaround to be less precise 2021-05-29 09:17:16 -07:00
Kubernetes Prow Robot 78d3a6e380
Merge pull request #398 from thockin/release-3.x
Downgrade libcurl to work around HTTP bug (v3)
2021-05-29 06:22:24 -07:00
Tim Hockin 3f0d678d19 Add a testcase for github HTTPS 2021-05-28 14:18:20 -07:00
Tim Hockin 71f1bce7bd Downgrade libcurl to avoid HTTP bug 2021-05-27 10:17:38 -07:00
Tim Hockin b8c2e1a03d Dockerfile: apt install with --no-install-recommends 2021-05-27 10:01:35 -07:00
Tim Hockin 121999d92c Dockerfile: use apt-get (more stable) 2021-05-27 09:59:34 -07:00
Tim Hockin e92d277745 Makefile: plain output when building container 2021-05-27 09:58:01 -07:00
Tim Hockin a93350aa8f Dockerfile: use multi-stage for cleaner result 2021-05-27 09:56:11 -07:00
Tim Hockin 4765eb5b14 Make sure all code files have headers 2021-05-27 08:45:36 -07:00
Tim Hockin ba20771195 Small error string cleanup 2021-05-26 17:02:54 -07:00
Kubernetes Prow Robot 0ae9a0a8c5
Merge pull request #389 from nan-yu/release-3.x
Grant read access for the error file to all users
2021-05-26 14:47:39 -07:00