-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
hubble: switch to google.golang.org/protobuf #14635
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update v1.Event.Timestamp and various other code to use google.golang.org/protobuf/types/known/timestamppb instead of of the deprecated github.com/golang/protobuf/ptypes/timestamp package. This works because github.com/golang/protobuf/ptypes/timestamp.Timestamp is type aliased to google.golang.org/protobuf/types/known/timestamppb.Timestamp, so they can be used interchangeably. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Update Hubble code to use google.golang.org/protobuf/types/known/wrapperspb instead of of the deprecated github.com/golang/protobuf/ptypes/wrappers package. This works because the github.com/golang/protobuf/ptypes/wrappers types are type aliased to the respective types google.golang.org/protobuf/types/known/wrapperspb, so they can be used interchangeably. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
…onversions Now that google.golang.org/protobuf/types/known/timestamppb.Timestamp is used directly (see previous commits), use its methods to check timestamp validity and convert it to time.Time. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Use google.golang.org/protobuf/encoding/protojson instead of the deprecated github.com/golang/protobuf/jsonpb to unmarshal JSON to protobuf. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
tklauser
added
release-note/misc
This PR makes changes that have no direct user impact.
sig/hubble
Impacts hubble server or relay
labels
Jan 18, 2021
tklauser
changed the title
hubble: switch to google.golang.org/protobuf packages
hubble: switch to google.golang.org/protobuf
Jan 18, 2021
test-me-please |
rolinh
approved these changes
Jan 18, 2021
gandro
approved these changes
Jan 18, 2021
kaworu
approved these changes
Jan 18, 2021
retest-4.19 hit #12690 (https://jenkins.cilium.io/job/Cilium-PR-Ginkgo-Tests-Kernel/4475/) |
retest-runtime hit #14640 (https://jenkins.cilium.io/job/Cilium-PR-Runtime-4.9/3337/) |
retest-net-next looks like #12511 (https://jenkins.cilium.io/job/Cilium-PR-K8s-1.13-net-next/488/) |
christarazi
approved these changes
Jan 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
release-note/misc
This PR makes changes that have no direct user impact.
sig/hubble
Impacts hubble server or relay
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use the
google.golang.org/protobuf/*
packages instead of their deprecated counterparts ingithub.com/golang/protobuf
. Note thatapi/v1/hubble
still uses the deprecated packages due to the fact that is uses an older version ofprotoc-gen-go
. An attempt to update it is in progress in #13405. Still, we can already use the types from the new packages and assign them to the API fields because the deprecated package type aliases them to the new package's type, e.g.cilium/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
Line 15 in 9a4c693
See individual commit messages for more details.
As previously suggested in #14168 (comment). Following cilium/hubble#452 which did the same for the Hubble CLI.