Skip to content

Commit

Permalink
Merge pull request #315 from cfergeau/debug
Browse files Browse the repository at this point in the history
Improve gvproxy error reporting, and improve gvproxy --version in a corner case
  • Loading branch information
openshift-merge-bot[bot] authored Feb 1, 2024
2 parents 49905e8 + 2d837fd commit 493d512
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
go-version: ["1.20.x", "1.21.x", "1.22.0-rc.1"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # history/tags are needed for automatic version generation
fetch-tags: true

- name: Set up Go
uses: actions/setup-go@v3
Expand Down
13 changes: 6 additions & 7 deletions cmd/gvproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func main() {
})
// Wait for all of the go funcs to finish up
if err := groupErrs.Wait(); err != nil {
log.Error(err)
log.Errorf("gvproxy exiting: %v", err)
exitCode = 1
}
}
Expand Down Expand Up @@ -347,7 +347,7 @@ func run(ctx context.Context, g *errgroup.Group, configuration *types.Configurat
if vpnkitSocket != "" {
vpnkitListener, err := transport.Listen(vpnkitSocket)
if err != nil {
return err
return errors.Wrap(err, "vpnkit listen error")
}
g.Go(func() error {
vpnloop:
Expand All @@ -374,7 +374,7 @@ func run(ctx context.Context, g *errgroup.Group, configuration *types.Configurat
if qemuSocket != "" {
qemuListener, err := transport.Listen(qemuSocket)
if err != nil {
return err
return errors.Wrap(err, "qemu listen error")
}

g.Go(func() error {
Expand All @@ -389,7 +389,6 @@ func run(ctx context.Context, g *errgroup.Group, configuration *types.Configurat
conn, err := qemuListener.Accept()
if err != nil {
return errors.Wrap(err, "qemu accept error")

}
return vn.AcceptQemu(ctx, conn)
})
Expand All @@ -398,7 +397,7 @@ func run(ctx context.Context, g *errgroup.Group, configuration *types.Configurat
if bessSocket != "" {
bessListener, err := transport.Listen(bessSocket)
if err != nil {
return err
return errors.Wrap(err, "bess listen error")
}

g.Go(func() error {
Expand All @@ -422,7 +421,7 @@ func run(ctx context.Context, g *errgroup.Group, configuration *types.Configurat
if vfkitSocket != "" {
conn, err := transport.ListenUnixgram(vfkitSocket)
if err != nil {
return err
return errors.Wrap(err, "vfkit listen error")
}

g.Go(func() error {
Expand All @@ -436,7 +435,7 @@ func run(ctx context.Context, g *errgroup.Group, configuration *types.Configurat
g.Go(func() error {
vfkitConn, err := transport.AcceptVfkit(conn)
if err != nil {
return err
return errors.Wrap(err, "vfkit accept error")
}
return vn.AcceptVfkit(ctx, vfkitConn)
})
Expand Down
10 changes: 10 additions & 0 deletions pkg/types/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ func moduleVersion() string {
return gitArchiveVersion
// This will be set when building from git using make
case gitVersion != "":
if !strings.HasPrefix(gitVersion, "v") {
// if an annotated tag is found, the git describe string will be similar to:
// v0.7.2-15-g2c897d90
// When using shallow clones, the commit being built
// may not have an annotated tag in its history,
// `git describe` will only be the abbreviated commit hash in this case:
// 2c897d90
return fmt.Sprintf("git%s", gitVersion)

}
return gitVersion
// moduleVersionFromBuildInfo() will be set when using `go install`
default:
Expand Down

0 comments on commit 493d512

Please sign in to comment.