-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump consul/proto-public and create mocks #406
Conversation
@@ -40,7 +41,7 @@ func genRandomBytes(size int) (blk []byte) { | |||
} | |||
|
|||
func (s *DNSTestSuite) Test_DisabledServer() { | |||
mockedDNSConsulClient := pbdns.NewMockDNSServiceClient(s.T()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewMockDNSServiceClient
no longer exists in github.com/hashicorp/consul/proto-public/pbdns
@jjti qq: is this meant to be supported in the next release (Consul 1.18/dataplane 1.14)? |
@wilkermichael yes that's correct |
Ok, we'll need to add a backport label, just waiting for it to be created. The release process is still ongoing for dataplane |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and thanks for this fix! See my comment about the changelog.
One rhetorical point that has nothing to do with this PR: it's weird we got rid of the mocks to cut down on dependencies in proto-public
, but we ended up pulling in a ton of K8s dependencies. 🤷
I hear you @DanStough and that's something I'll call out here: it appears to increase the consul-dataplane binary size ~50% (19M > 29M): # josh @ josh-XWGWHJ0JV2 in ~/GitHub/hashicorp/consul-dataplane on git:bump-protos
$ make bin
GOARCH=arm64 GOOS=linux CGO_ENABLED=0 go build -trimpath -buildvcs=false -ldflags="-X github.com/hashicorp/consul-dataplane/pkg/version.GitCommit=6ddd5cc" -o dist/linux/arm64/consul-dataplane ./cmd/consul-dataplane
# josh @ josh-XWGWHJ0JV2 in ~/GitHub/hashicorp/consul-dataplane on git:jjti/bump-protos o [16:26:52]
$ ll dist/linux/arm64/consul-dataplane
-rwxr-xr-x 1 josh staff 29M Feb 2 16:22 dist/linux/arm64/consul-dataplane
# josh @ josh-XWGWHJ0JV2 in ~/GitHub/hashicorp/consul-dataplane on git:main o [16:33:17]
$ make bin
GOARCH=arm64 GOOS=linux CGO_ENABLED=0 go build -trimpath -buildvcs=false -ldflags="-X github.com/hashicorp/consul-dataplane/pkg/version.GitCommit=6ddd5cc" -o dist/linux/arm64/consul-dataplane ./cmd/consul-dataplane
# josh @ josh-XWGWHJ0JV2 in ~/GitHub/hashicorp/consul-dataplane on git:main o [16:33:26]
$ ll dist/linux/arm64/consul-dataplane
-rwxr-xr-x 1 josh staff 19M Feb 2 16:33 dist/linux/arm64/consul-dataplane Similar/same increase image for the image: 139MB to 150MB |
There was a discussion about this in Slack. The gateway team will look at removing the generated code import of k8s to avoid this increase. Ie this increase in size, from this PR, is temporary until the next tagged release of |
Changes
This pulls in the latest public proto specifications from consul's proto-public package. We need this for a subsequent PR that references the newly created
TelemetryState
struct: #370Bumping
proto-public
breaks the tests inpkg/dns/dns_test.go
because the referenced mock is no longer exported. To get around that, while keeping the dns changes largely unchanged, a new mockery mock is created using the newly added make target below:The
pbresource
mocks are also added here as they are used in the next PR.Testing
These changes were pulled out of the follow-up PR where they were tested by building + deploying a custom build of consul-dataplane using these changes.