Skip to content

Commit

Permalink
Upgrade to code.cloudfoundry.org/cfhttp/v2
Browse files Browse the repository at this point in the history
- Updates the client used to the non-deprecated cfhttp/v2
- Upgrades go.mods to actually `tidy` and `vendor` correctly

[#187603786](https://www.pivotaltracker.com/story/show/187603786)
  • Loading branch information
jrussett authored and tcdowney committed May 16, 2024
1 parent 44f1853 commit 1252a50
Show file tree
Hide file tree
Showing 162 changed files with 12,672 additions and 9,928 deletions.
25 changes: 15 additions & 10 deletions cmd/cc-uploader/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ import (
"net/http/httptest"
"net/url"
"os"
"os/exec"
"path/filepath"
"time"

"code.cloudfoundry.org/cc-uploader"
ccuploader "code.cloudfoundry.org/cc-uploader"
"code.cloudfoundry.org/cc-uploader/ccclient/fake_cc"
"code.cloudfoundry.org/cc-uploader/config"
"code.cloudfoundry.org/cfhttp"
"code.cloudfoundry.org/cfhttp/v2"
"code.cloudfoundry.org/runtimeschema/cc_messages"
"code.cloudfoundry.org/tlsconfig"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"github.com/onsi/gomega/gexec"
"os/exec"
)

type ByteEmitter struct {
Expand Down Expand Up @@ -177,14 +178,18 @@ var _ = Describe("CC Uploader", func() {

BeforeEach(func() {
ccUploaderAddress = fmt.Sprintf("https://localhost:%d", httpsListenPort)
httpClient = cfhttp.NewClient()
cellTLSConfig, err := cfhttp.NewTLSConfig(
filepath.Join("..", "..", "fixtures", "certs", "client.crt"),
filepath.Join("..", "..", "fixtures", "certs", "client.key"),
filepath.Join("..", "..", "fixtures", "certs", "ca.crt"),
)

clientCertFilePath := filepath.Join("..", "..", "fixtures", "certs", "client.crt")
clientKeyFilePath := filepath.Join("..", "..", "fixtures", "certs", "client.key")
clientCAFilePath := filepath.Join("..", "..", "fixtures", "certs", "ca.crt")

clientTlSConfig, err := tlsconfig.Build(
tlsconfig.WithIdentityFromFile(clientCertFilePath, clientKeyFilePath),
).Client(tlsconfig.WithAuthorityFromFile(clientCAFilePath))

Expect(err).NotTo(HaveOccurred())
httpClient.Transport = &http.Transport{TLSClientConfig: cellTLSConfig}

httpClient = cfhttp.NewClient(cfhttp.WithTLSConfig(clientTlSConfig))
})

Context("when the CC callback URI is HTTP", func() {
Expand Down
31 changes: 17 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ go 1.20

require (
code.cloudfoundry.org/cfhttp v2.0.1-0.20190228180516-1f526aa7822e+incompatible
code.cloudfoundry.org/debugserver v0.0.0-20230612151301-d597b20f28ce
code.cloudfoundry.org/cfhttp/v2 v2.0.1
code.cloudfoundry.org/debugserver v0.0.0-20240510172920-2e46c6dc69d9
code.cloudfoundry.org/lager/v3 v3.0.3
code.cloudfoundry.org/runtimeschema v0.0.0-20230323223330-5366865eed76
code.cloudfoundry.org/runtimeschema v0.0.0-20240514235758-31be7684c5bf
code.cloudfoundry.org/tlsconfig v0.0.0-20240516170203-d50b3d56ba06
github.com/cloudfoundry/dropsonde v1.1.0
github.com/onsi/ginkgo/v2 v2.17.3
github.com/onsi/gomega v1.33.1
Expand All @@ -15,23 +17,24 @@ require (
)

require (
code.cloudfoundry.org/bbs v0.0.0-20230214212838-952b49bdead8 // indirect
code.cloudfoundry.org/lager v2.0.0+incompatible // indirect
code.cloudfoundry.org/bbs v0.0.0-20240418184526-a7ed0dccd9f7 // indirect
github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect
github.com/cloudfoundry/sonde-go v0.0.0-20220627221915-ff36de9c3435 // indirect
github.com/cloudfoundry/sonde-go v0.0.0-20240515174134-adba8bce1248 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/google/pprof v0.0.0-20240509144519-723abb6459b7 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect
github.com/openzipkin/zipkin-go v0.4.2 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.20.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
github.com/openzipkin/zipkin-go v0.4.3 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240509183442-62759503f434 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
76 changes: 42 additions & 34 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vendor/code.cloudfoundry.org/bbs/format/envelope.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/code.cloudfoundry.org/bbs/format/format.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/code.cloudfoundry.org/bbs/format/versioner.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 33 additions & 9 deletions vendor/code.cloudfoundry.org/bbs/models/actual_lrp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1252a50

Please sign in to comment.