Skip to content

Commit 902354c

Browse files
committed
pingdb: consolidate into switchboard module
[TNZ-66259](https://vmw-jira.broadcom.net/browse/TNZ-66259)
1 parent 7e09d85 commit 902354c

861 files changed

Lines changed: 24 additions & 475271 deletions

File tree

Some content is hidden

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

packages/proxy/packaging

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
#!/usr/bin/env bash
22

3-
set -eu
3+
set -o errexit -o nounset -o pipefail
44

55
source /var/vcap/packages/golang-1-linux/bosh/compile.env
66

7-
cd github.com/cloudfoundry-incubator/switchboard
8-
go build -mod=vendor -o "${BOSH_INSTALL_TARGET}/bin/proxy"
9-
cp -r static "${BOSH_INSTALL_TARGET}/static"
10-
cd -
11-
cd github.com/cloudfoundry-incubator/switchboard/pingdb
12-
go build -mod=vendor -o "${BOSH_INSTALL_TARGET}"/bin/pingdb
13-
cd -
7+
export GOBIN=${BOSH_INSTALL_TARGET}/bin
8+
go -C github.com/cloudfoundry-incubator/switchboard install -mod=vendor ./cmd/...
9+
cp -r github.com/cloudfoundry-incubator/switchboard/static "${BOSH_INSTALL_TARGET}/static"

src/github.com/cloudfoundry-incubator/switchboard/pingdb/pingdb.go renamed to src/github.com/cloudfoundry-incubator/switchboard/cmd/pingdb/main.go

File renamed without changes.

src/github.com/cloudfoundry-incubator/switchboard/pingdb/pingdb_suite_test.go renamed to src/github.com/cloudfoundry-incubator/switchboard/cmd/pingdb/main_suite_test.go

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

33
import (
4+
"testing"
5+
46
. "github.com/onsi/ginkgo/v2"
57
. "github.com/onsi/gomega"
68
"github.com/onsi/gomega/gexec"
7-
8-
"testing"
99
)
1010

1111
var (
@@ -19,7 +19,7 @@ func TestPingDB(t *testing.T) {
1919

2020
var _ = BeforeSuite(func() {
2121
var err error
22-
pingdbPath, err = gexec.Build("pingdb")
22+
pingdbPath, err = gexec.Build("github.com/cloudfoundry-incubator/switchboard/cmd/pingdb")
2323
Expect(err).NotTo(HaveOccurred())
2424
})
2525

src/github.com/cloudfoundry-incubator/switchboard/pingdb/pingdb_test.go renamed to src/github.com/cloudfoundry-incubator/switchboard/cmd/pingdb/main_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import (
99
. "github.com/onsi/gomega"
1010
"github.com/onsi/gomega/gbytes"
1111
"github.com/onsi/gomega/gexec"
12-
"pingdb/internal/testing/docker"
12+
13+
"github.com/cloudfoundry-incubator/switchboard/internal/testing/docker"
1314
)
1415

1516
var _ = Describe("PingDB", func() {

src/github.com/cloudfoundry-incubator/switchboard/main.go renamed to src/github.com/cloudfoundry-incubator/switchboard/cmd/proxy/main.go

File renamed without changes.

src/github.com/cloudfoundry-incubator/switchboard/main_suite_test.go renamed to src/github.com/cloudfoundry-incubator/switchboard/cmd/proxy/main_suite_test.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package main_test
22

33
import (
4-
"path"
5-
"runtime"
64
"testing"
75

86
. "github.com/onsi/ginkgo/v2"
@@ -11,7 +9,7 @@ import (
119
)
1210

1311
const (
14-
switchboardPackage = "github.com/cloudfoundry-incubator/switchboard/"
12+
switchboardPackage = "github.com/cloudfoundry-incubator/switchboard/cmd/proxy"
1513
)
1614

1715
func TestSwitchboard(t *testing.T) {
@@ -29,11 +27,6 @@ var _ = BeforeSuite(func() {
2927
Expect(err).NotTo(HaveOccurred())
3028
})
3129

32-
func getDirOfCurrentFile() string {
33-
_, filename, _, _ := runtime.Caller(1)
34-
return path.Dir(filename)
35-
}
36-
3730
var _ = AfterSuite(func() {
3831
gexec.CleanupBuildArtifacts()
3932
})

src/github.com/cloudfoundry-incubator/switchboard/main_test.go renamed to src/github.com/cloudfoundry-incubator/switchboard/cmd/proxy/main_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ var _ = Describe("Switchboard", func() {
281281
err error
282282
testCA []byte
283283
)
284-
testDir := getDirOfCurrentFile()
285-
staticDir = filepath.Join(testDir, "static")
284+
staticDir, err = filepath.Abs("../../static")
285+
Expect(err).NotTo(HaveOccurred())
286286

287287
testCA, testCert, err = testing.GenerateSelfSignedCertificate("localhost")
288288
Expect(err).NotTo(HaveOccurred())

src/github.com/cloudfoundry-incubator/switchboard/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ go 1.24.9
55
require (
66
code.cloudfoundry.org/lager/v3 v3.55.0
77
code.cloudfoundry.org/tlsconfig v0.41.0
8+
github.com/go-sql-driver/mysql v1.9.3
9+
github.com/google/uuid v1.6.0
810
github.com/maxbrunsfeld/counterfeiter/v6 v6.12.1
911
github.com/onsi/ginkgo/v2 v2.27.3
1012
github.com/onsi/gomega v1.38.3

src/github.com/cloudfoundry-incubator/switchboard/go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,8 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
697697
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
698698
github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
699699
github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
700+
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
701+
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
700702
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
701703
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
702704
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
@@ -786,6 +788,8 @@ github.com/google/pprof v0.0.0-20251208000136-3d256cb9ff16/go.mod h1:67FPmZWbr+K
786788
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
787789
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
788790
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
791+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
792+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
789793
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
790794
github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
791795
github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg=

src/github.com/cloudfoundry-incubator/switchboard/pingdb/internal/testing/docker/docker.go renamed to src/github.com/cloudfoundry-incubator/switchboard/internal/testing/docker/docker.go

File renamed without changes.

0 commit comments

Comments
 (0)