Skip to content

Commit

Permalink
Drop forwarding by default (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Jan 26, 2024
1 parent 302f7d4 commit 69661c5
Show file tree
Hide file tree
Showing 15 changed files with 177 additions and 513 deletions.
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

0 comments on commit 69661c5

Please sign in to comment.