Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop forwarding by default #214

Merged
merged 9 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: google-github-actions/auth@v1
with:
Expand All @@ -31,9 +31,10 @@ jobs:
uses: google-github-actions/setup-gcloud@v0

- name: Set up Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
cache: false

- name: Lint
uses: golangci/golangci-lint-action@v3
Expand Down Expand Up @@ -84,7 +85,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: google-github-actions/auth@v1
with:
Expand All @@ -94,7 +95,7 @@ jobs:
uses: google-github-actions/setup-gcloud@v0

- name: Set up Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
cache: false
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: google-github-actions/auth@v1
with:
Expand All @@ -31,7 +31,7 @@ jobs:
uses: google-github-actions/setup-gcloud@v0

- name: Set up Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
cache: false
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: google-github-actions/auth@v1
with:
Expand All @@ -97,9 +97,10 @@ jobs:
uses: google-github-actions/setup-gcloud@v0

- name: Set up Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
cache: false

- name: build install
run: make
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
# it adds a generated download table to the release body with images from the stable folder.

# - name: Checkout
# uses: actions/checkout@v3
# uses: actions/checkout@v4

# - name: Set up Go 1.20
# uses: actions/setup-go@v4
# uses: actions/setup-go@v5
# with:
# go-version: '1.20.x'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
uses: google-github-actions/setup-gcloud@v0

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go 1.21
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
cache: false
Expand Down
13 changes: 6 additions & 7 deletions cmd/cmdexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ package main
import (
"context"
"io"
"log/slog"
"os"
"os/exec"
"strings"
"time"

"go.uber.org/zap"
)

type cmdexec struct {
log *zap.SugaredLogger
log *slog.Logger
c func(ctx context.Context, name string, arg ...string) *exec.Cmd
}

Expand All @@ -31,7 +30,7 @@ func (i *cmdexec) command(p *cmdParams) (out string, err error) {
start = time.Now()
output []byte
)
i.log.Infow("running command", "commmand", strings.Join(append([]string{p.name}, p.args...), " "), "start", start.String())
i.log.Info("running command", "commmand", strings.Join(append([]string{p.name}, p.args...), " "), "start", start.String())

ctx := context.Background()
if p.timeout != 0 {
Expand Down Expand Up @@ -60,7 +59,7 @@ func (i *cmdexec) command(p *cmdParams) (out string, err error) {
defer stdin.Close()
_, err = io.WriteString(stdin, p.stdin)
if err != nil {
i.log.Errorw("error when writing to command's stdin", "error", err)
i.log.Error("error when writing to command's stdin", "error", err)
}
}()
}
Expand All @@ -75,11 +74,11 @@ func (i *cmdexec) command(p *cmdParams) (out string, err error) {
took := time.Since(start)

if err != nil {
i.log.Errorw("executed command with error", "output", out, "duration", took.String(), "error", err)
i.log.Error("executed command with error", "output", out, "duration", took.String(), "error", err)
return "", err
}

i.log.Infow("executed command", "output", out, "duration", took.String())
i.log.Info("executed command", "output", out, "duration", took.String())

return
}
Loading
Loading