Skip to content

Commit

Permalink
hacking
Browse files Browse the repository at this point in the history
  • Loading branch information
thockin committed Jun 9, 2024
1 parent 12a7d9c commit 59b002f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3,059 deletions.
1 change: 1 addition & 0 deletions _test_tools/sshd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ VOLUME /dot_ssh

# Callers should mount a directory with git repos here.
VOLUME /git
RUN git config --global safe.directory '*'

# Callers can SSH as user "test"
RUN echo "test:x:65533:65533::/home/test:/usr/bin/git-shell" >> /etc/passwd
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,9 @@ func main() {
updateSyncMetrics(metricKeyError, start)
if *flMaxFailures >= 0 && failCount >= *flMaxFailures {
// Exit after too many retries, maybe the error is not recoverable.
git.run.WithCallDepth(1).Run(ctx, git.root.String(), nil, "ls", "-lran")

Check failure on line 833 in main.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `(k8s.io/git-sync/pkg/cmd.Runner).Run` is not checked (errcheck)
git.run.WithCallDepth(1).Run(ctx, git.root.String(), nil, "git", "config", "--get", "safe.directory")

Check failure on line 834 in main.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `(k8s.io/git-sync/pkg/cmd.Runner).Run` is not checked (errcheck)
git.run.WithCallDepth(1).Run(ctx, git.root.String(), nil, "git", "config", "--list")

Check failure on line 835 in main.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `(k8s.io/git-sync/pkg/cmd.Runner).Run` is not checked (errcheck)
log.Error(err, "too many failures, aborting", "failCount", failCount)
os.Exit(1)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func runWithStdin(ctx context.Context, log logintf, cwd string, env []string, st
return stdout, stderr, fmt.Errorf("Run(%s): %w: { stdout: %q, stderr: %q }", cmdStr, ctx.Err(), stdout, stderr)
}
if err != nil {
log.V(6).Error(err, "command result", "stdout", stdout, "stderr", stderr, "time", wallTime)
return stdout, stderr, fmt.Errorf("Run(%s): %w: { stdout: %q, stderr: %q }", cmdStr, err, stdout, stderr)
}
log.V(6).Info("command result", "stdout", stdout, "stderr", stderr, "time", wallTime)
Expand Down
Loading

0 comments on commit 59b002f

Please sign in to comment.