Commit Graph

975 Commits

Author SHA1 Message Date
Tim Hockin a0379cbcd4 Bump go to 1.16 2021-04-23 09:00:59 -07:00
Tim Hockin a8a7ffb5a2 Sort the flags in the manual output 2021-04-21 21:48:55 -07:00
Kubernetes Prow Robot 79498367fc
Merge pull request #375 from nan-yu/master
Export the error details to an error file
2021-04-21 21:42:34 -07:00
Nan Yu 53f3fa17a0 Export the error details to an error file
The current git-sync process outputs the error information to standard
out, which is inaccessible from outside the container. Users have to
dump the logs using kubectl logs in order to check the error details in
the git-sync process. This commit exports the error details to a file,
which provides users the capability to check the errors directly from
other sidecar containers.

proposal: https://github.com/kubernetes/git-sync/issues/326
2021-04-21 16:42:28 -07:00
Tim Hockin 6ac6e4eefd Fix licenses for other arch'es 2021-04-16 08:22:18 -07:00
Tim Hockin bb6f4441fd Update to latest base image debian-base:buster-v1.6.0 (v4) 2021-04-15 08:44:15 -07:00
Nan Yu f2581cff93 Export the error details to an error file
The current git-sync process outputs the error information to standard
out, which is inaccessible from outside the container. Users have to
dump the logs using kubectl logs in order to check the error details in
the git-sync process. This commit exports the error details to a file,
which provides users the capability to check the errors directly from
other sidecar containers.

proposal: https://github.com/kubernetes/git-sync/issues/326
2021-04-09 11:33:16 -07:00
Kubernetes Prow Robot 13af14e3bf
Merge pull request #370 from thockin/exec-hook-after-symlink-v4
Move sync-hook to after symlink flip
2021-04-07 16:47:42 -07:00
Kubernetes Prow Robot e0fe34164d
Merge pull request #366 from thockin/licenses-v4
Copy all licenses into the container image (v4)
2021-04-07 05:17:53 -07:00
Tim Hockin d6c1fd3c6b Move sync-hook to after symlink flip 2021-04-05 17:02:00 -07:00
Tim Hockin 592cbcb9d0 update go.mod to 1.16 2021-03-29 21:16:23 -07:00
Tim Hockin ed5e78472e Copy all licenses into the container image 2021-03-29 16:54:35 -07:00
Tim Hockin f77e3a54fc Add infrastructure for build tools
As per discussion with Go team.  it's hacky but it works.

create tools.go
git add tools.go
go mod vendor
git add vendor
go mod tidy
go mod vendor # again
2021-03-29 16:51:08 -07:00
Tim Hockin dcb918f846 WIP: startup tests 2021-03-29 16:48:50 -07:00
Kubernetes Prow Robot d89ac710a2
Merge pull request #362 from thockin/build-no-tty-v4
Don't require a TTY to build/test
2021-03-18 05:29:19 -07:00
Tim Hockin ac6f5036a2 Don't require a TTY to build/test 2021-03-17 22:02:32 -07:00
Kubernetes Prow Robot 7b594781f8
Merge pull request #344 from thockin/fix-pid1-exit-code-v4
Fix exit non-zero exit codes when running as pid1
2021-03-15 09:39:06 -07:00
Tim Hockin 45b28530a7 Fix exit non-zero exit codes when running as pid1
(v4 branch)

Prior to this we would swallow the exit code and always exit(0).
2021-03-15 09:28:26 -07:00
Kubernetes Prow Robot 03c87de032
Merge pull request #342 from thockin/add-git-configs-flag-4.x
Add --git-config flag
2021-03-15 09:27:06 -07:00
Tim Hockin 83b4dd21de Add --git-config flag
This allows arbitrary git configs to be passed in.  For example:

`git config --global http.postBuffer 1048576000`

`git config --global http.sslCAInfo /path/to/cert/file`

`git config --global http.sslVerify false`

This flag takes a comma-separated list of `key:val` pairs.  The key part
is passed to `git config` and must be a valid gitconfig section header
and variable name.  The val part can be either a quoted or unquoted
value.  For all values the following escape sequences are supported:
   * `\n` => [newline]
   * `\t` => [tab]
   * `\"` => `"`
   * `\,` => `,`
   * `\\` => `\`

Within unquoted values, commas MUST be escaped. Within quoted values,
commas MAY be escaped, but are not required to be.  Any other escape
sequence is an error.

Example:

`--git-config=foo.one:val1,foo.two:"quoted val",foo.three:12345`

This commit exposed a bug in runCommand() which modified its args when
they had an embedded space.
2021-03-15 09:20:02 -07:00
Kubernetes Prow Robot 6f5c1a9a22
Merge pull request #353 from thockin/fix-v4-tests
Fix tests on master - reset needs "--" arg
2021-03-15 09:17:05 -07:00
Tim Hockin cc094858b3 Fix tests on master - reset needs "--" arg
Now that the worktree dirs are the same name as the hash, `git reset`
doesn't know if we are asking for reset-to-hash or reset-the-dir.
Adding "--" makes that unambiguous.

Tests pass now.
2021-03-15 08:59:34 -07:00
Kubernetes Prow Robot d02bcce8e5
Merge pull request #351 from thockin/readlink-is-api-v4
Change the symlink targets to just the SHA (v4)
2021-03-12 02:58:17 -08:00
Kubernetes Prow Robot aab6380c0d
Merge pull request #349 from thockin/build-no-cache-v4
Build container without cache
2021-03-12 02:56:17 -08:00
Kubernetes Prow Robot a8660c02bf
Merge pull request #347 from thockin/update-git-v4
Update git from backports
2021-03-12 02:54:17 -08:00
Tim Hockin e5a438e446 Change the symlink targets to just the SHA
This allows users to call readlink() on the link and learn the current
checked out SHA.
2021-03-11 22:11:35 -08:00
Tim Hockin 813337fe2d Update git from backports
Some bugs have been fixed that impact some users.
2021-03-11 22:11:35 -08:00
Tim Hockin a082bf83cf Build container without cache 2021-03-11 19:25:01 -08:00
Tim Hockin 858cc8d735 Update git from backports
Some bugs have been fixed that impact some users.
2021-03-11 19:23:13 -08:00
Kubernetes Prow Robot 45852714fc
Merge pull request #336 from justaugustus/image
Makefile: Update base and build images
2021-02-12 11:01:59 -08:00
Stephen Augustus 35507943ce Makefile: Update base and build images
- base: debian-base:v2.0.0 --> debian-base:buster-v1.4.0
- build: golang:1.14-alpine --> golang:1.15-alpine

Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-02-12 12:15:59 -05:00
Kubernetes Prow Robot 14b9f07f58
Merge pull request #332 from thockin/v4-e2e-use-docker-nc
Use docker to run helper servers in e2e
2021-02-03 03:02:29 -08:00
Tim Hockin ccde597b7d Always specify branch name in e2e
As git changes the default from "master" to "main", it's not
predictable.  Now the test owns the decision.

This was already merged on release-3.x.
2021-01-23 16:13:26 -08:00
Tim Hockin a285a770e2 Use docker to run helper servers in e2e
Reliably cleaning up leftover things like `nc` processes is surprisingly
difficult in pure shell.  e2e passes on the master branch now.
2021-01-23 15:59:24 -08:00
Kubernetes Prow Robot 75bfc00fb6
Merge pull request #330 from thockin/v4-container-mkdir
Default the git-sync root dir in container
2021-01-22 04:35:27 -08:00
Tim Hockin b6a1c61e83 Default the git-sync root dir in container
This should make the container image easier to use, without defaulting
the root dir in non-container usage.
2021-01-21 12:37:07 -08:00
Tim Hockin 02d291c495 Set HOME in Dockerfile
Clean up other comments, too.
2021-01-21 12:37:07 -08:00
Kubernetes Prow Robot e52396c9fd
Merge pull request #328 from thockin/pod-yaml-doc
Add an example pod YAML
2021-01-21 01:55:03 -08:00
Tim Hockin 08fbf383f8 Add an example pod YAML 2021-01-20 16:28:57 -08:00
Kubernetes Prow Robot 6f8ecc6caa
Merge pull request #323 from thockin/log-uid-gid
Log info about UID, GID, and HOME for debug
2021-01-07 05:59:45 -08:00
Kubernetes Prow Robot 6f3d9e4e16
Merge pull request #322 from thockin/parse-int
Allow octal and hex values for int flags
2021-01-07 05:57:46 -08:00
Tim Hockin e2bc4c3ea0 Log info about UID, GID, and HOME for debug 2021-01-06 13:52:08 -08:00
Tim Hockin e7eecc31a1 Allow octal and hex values for int flags
This is specifcally relevant to --change-permissions.
2021-01-06 13:46:25 -08:00
Kubernetes Prow Robot b631e42946
Merge pull request #318 from thockin/master
Change CONTRIBUTING.md to CNCF CLA
2020-12-23 11:30:27 -08:00
Tim Hockin 1c1f52f437 Change CONTRIBUTING.md to CNCF CLA 2020-12-23 10:59:38 -08:00
Kubernetes Prow Robot 22f69061ff
Merge pull request #307 from haiyanmeng/doc
Add the `--root` flag into the Usage section
2020-11-17 22:06:05 -08:00
Haiyan Meng 0010dafe6d Add the `--root` flag into the Usage section 2020-11-17 18:44:35 -08:00
Kubernetes Prow Robot 14b9e286f0
Merge pull request #304 from thockin/5-main-struct
Add a "main struct" with methods
2020-11-13 04:48:24 -08:00
Tim Hockin c410bb5610 Add a main struct, part 8
This commit encapsulates the authURL parameter.
2020-11-10 10:21:20 -08:00
Tim Hockin 4d808d47ed Add a main struct, part 7
This commit encapsulates the chmod and link parameters.
2020-11-10 10:21:20 -08:00