Skip to content

Commit ea7a1d7

Browse files
authored
25q5 (#8)
* chore(go): bump toolchain to 1.24 and tidy vendor Body - Update go.mod go directive to 1.24 - Ran go mod tidy and refreshed vendor * chore(release): add versioned build target, embed version, bump to v1.1.3 - Add Makefile release target producing scs-broker-${VERSION}-linux-amd64 with ldflags - Introduce Version var + -version flag and log version on startup - Embed version via -X main.Version - Remove unused httpartifacttransport / httpTransport - Bump VERSION to 1.1.3
1 parent 5acc065 commit ea7a1d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+534
-148
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ manifest:
1010
build:
1111
go build
1212

13+
release:
14+
@set -e; \
15+
VERSION=$$(cat VERSION); \
16+
echo "Building scs-broker-$${VERSION}-linux-amd64"; \
17+
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.Version=$${VERSION}" -o scs-broker-$${VERSION}-linux-amd64 .
18+

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.1.3

go.mod

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/cloudfoundry-community/scs-broker
22

3-
go 1.22
3+
go 1.24
44

55
replace github.com/docker/docker => github.com/docker/engine v17.12.0-ce-rc1.0.20200531234253-77e06fda0c94+incompatible
66

@@ -19,7 +19,6 @@ require (
1919
github.com/cloudfoundry-community/go-cfclient/v2 v2.0.0
2020
github.com/cloudfoundry-community/go-uaa v0.3.3
2121
github.com/cloudfoundry-community/spring-cloud-services-cli-config-parser v1.0.3
22-
github.com/moby/term v0.5.0
2322
github.com/pivotal-cf/brokerapi v6.4.2+incompatible
2423
gopkg.in/yaml.v3 v3.0.1
2524
)
@@ -46,22 +45,21 @@ require (
4645
github.com/gorilla/mux v1.8.1 // indirect
4746
github.com/gorilla/websocket v1.5.3 // indirect
4847
github.com/jessevdk/go-flags v1.6.1 // indirect
49-
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
5048
github.com/mailru/easyjson v0.7.7 // indirect
5149
github.com/mattn/go-colorable v0.1.11 // indirect
5250
github.com/mattn/go-runewidth v0.0.16 // indirect
51+
github.com/moby/term v0.5.0 // indirect
5352
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
5453
github.com/pborman/uuid v1.2.1 // indirect
5554
github.com/pkg/errors v0.9.1 // indirect
5655
github.com/rivo/uniseg v0.4.7 // indirect
56+
github.com/rogpeppe/go-internal v1.14.1 // indirect
5757
github.com/sirupsen/logrus v1.9.3 // indirect
58-
github.com/stretchr/testify v1.9.0 // indirect
5958
github.com/tedsuo/rata v1.0.0 // indirect
60-
github.com/vito/go-interact v1.0.0 // indirect
6159
golang.org/x/crypto v0.26.0 // indirect
6260
golang.org/x/net v0.28.0 // indirect
6361
golang.org/x/oauth2 v0.22.0 // indirect
64-
golang.org/x/sys v0.24.0 // indirect
62+
golang.org/x/sys v0.26.0 // indirect
6563
golang.org/x/term v0.23.0 // indirect
6664
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
6765
gopkg.in/yaml.v2 v2.4.0 // indirect

go.sum

Lines changed: 47 additions & 73 deletions
Large diffs are not rendered by default.

main.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
package main
22

33
import (
4+
"flag"
5+
"fmt"
46
"net/http"
57
"os"
68

79
"code.cloudfoundry.org/lager"
810
"github.com/cloudfoundry-community/scs-broker/broker"
911
"github.com/cloudfoundry-community/scs-broker/config"
10-
"github.com/cloudfoundry-community/scs-broker/httpartifacttransport"
1112
"github.com/pivotal-cf/brokerapi"
1213
)
1314

1415
var brokerLogger lager.Logger
15-
var httpTransport httpartifacttransport.HttpArtifactTransport
16+
// (legacy) httpTransport removed; add back if artifact transport needed in future
17+
18+
// Version is overridden at build time via: -ldflags "-X main.Version=1.1.3"
19+
var Version = "dev"
1620

1721
func main() {
22+
showVersion := flag.Bool("version", false, "print version and exit")
23+
flag.Parse()
24+
25+
if *showVersion {
26+
fmt.Println(Version)
27+
return
28+
}
1829
brokerLogger = lager.NewLogger("scs-broker")
1930
brokerLogger.RegisterSink(lager.NewWriterSink(os.Stdout, lager.DEBUG))
2031
brokerLogger.RegisterSink(lager.NewWriterSink(os.Stderr, lager.ERROR))
@@ -26,7 +37,7 @@ func main() {
2637
})
2738
}
2839

29-
brokerLogger.Info("starting")
40+
brokerLogger.Info("starting", lager.Data{"version": Version})
3041

3142
serviceBroker := &broker.SCSBroker{
3243
Config: brokerConf,

vendor/golang.org/x/sys/unix/README.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/mkerrors.sh

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/syscall_aix.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/syscall_darwin.go

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/syscall_hurd.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)