-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
use containerd/containerd/api module #3526
base: master
Are you sure you want to change the base?
Conversation
akhilerm
commented
May 4, 2024
•
edited
Loading
edited
- use containerd/containerd/api module instead of having a copy in third_party
- use containerd/errdefs module instead of keeping a local copy
Hi @akhilerm. Thanks for your PR. I'm waiting for a google member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
Very exciting to see this happen! |
@bobbypage Can you approve the github action workflows also? |
/ok-to-test |
/cc @bobbypage @dims for review |
go.mod
Outdated
@@ -1,73 +1,74 @@ | |||
module github.com/google/cadvisor | |||
|
|||
go 1.19 | |||
go 1.22.0 | |||
|
|||
replace golang.org/x/net => golang.org/x/net v0.7.0 |
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.
@bobbypage Shouldnt this be removed? I am not sure why the version was pinned. Also v0.23.0
fixes CVE-2023-45288
/hold |
2f42059
to
7547a2f
Compare
@bobbypage Can you approve the workflow. I have rebased against the latest master branch |
@akhilerm, you have conflicts against master. |
7547a2f
to
144fff5
Compare
rebased against master and pushed the changes. |
144fff5
to
cad3611
Compare
The /retest pull-cadvisor-e2e |
@akhilerm: The
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/test pull-cadvisor-e2e |
1 similar comment
/test pull-cadvisor-e2e |
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.
Just two minor comments :)
@@ -33,7 +33,7 @@ import ( | |||
"context" | |||
"time" | |||
|
|||
"github.com/gogo/protobuf/types" | |||
anypb "google.golang.org/protobuf/types/known/anypb" |
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.
Is this alias necessary?
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.
FIxed.
// Copied from https://github.com/containerd/containerd/blob/main/pkg/protobuf/any.go | ||
// FromAny converts typeurl.Any to github.com/containerd/containerd/protobuf/types.Any. | ||
// | ||
// TODO: vendor these functions once they are moved to github.com/containerd/typeurl. | ||
// | ||
// Currently they are copied over so as not to introduce a dependency on containerd/containerd again | ||
func FromAny(from typeurl.Any) *anypb.Any { | ||
if from == nil { | ||
return nil | ||
} | ||
|
||
if pbany, ok := from.(*anypb.Any); ok { | ||
return pbany | ||
} | ||
|
||
return &anypb.Any{ | ||
TypeUrl: from.GetTypeUrl(), | ||
Value: from.GetValue(), | ||
} | ||
} | ||
|
||
// MarshalAnyToProto converts an arbitrary interface to github.com/containerd/containerd/protobuf/types.Any. | ||
func MarshalAnyToProto(from interface{}) (*anypb.Any, error) { | ||
anyType, err := typeurl.MarshalAny(from) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return FromAny(anyType), nil | ||
} |
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.
Can these two functions be unexported, please?
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.
There is a PR in containerd/typeurl#45, so that these funcs can be vendored and used instead of copying it over here.
cmd/go.mod
Outdated
@@ -44,6 +44,8 @@ require ( | |||
github.com/checkpoint-restore/go-criu/v5 v5.3.0 // indirect | |||
github.com/cilium/ebpf v0.7.0 // indirect | |||
github.com/containerd/console v1.0.3 // indirect | |||
github.com/containerd/containerd/api v1.8.0-rc.2 // indirect |
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.
This PR shall not be merged with RC version.
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.
This PR was raised so as to test the containerd/api module compatiblity with cadvisor. I am updating as each rc version releases so that we know there are no breaking changes.
PR needs to be merged only after containerd/api v1.8.0 is released.
More discussion on the same is happening on this thread https://kubernetes.slack.com/archives/CHGFYJVAN/p1714733633634819
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.
Note that API v1.7.19 has been tagged; the v1.8.0-rc is the API version from the main branch (containerd v2.0-dev), so depending on what's needed, maybe the v1.7.19 version is an option?
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.
Yes. Thats a better option. Will update to api/v1.7.19
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.
Done.
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.
Looks like the "indirect" here stuck on 1.8; could be either go modules's tendency to not downgrade once it's there, or could there be something else in the dependency tree pushing it up? 🤔
(Sorry, maybe you already noticed that, but just in case 🙈 🫶 )
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.
My bad. Hadnt checked the new diff before pushing. Thought tidy will downgrade it automatically. It was because of this
could be either go modules's tendency to not downgrade once it's there
running just a go mod tidy
will not downgrade, had to remove and run the tidy again so as to bring in 1.7.19 as indirect dependency.
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.
Yes, that fooled me many times; if a dependency version (based on the dependency tree "minimum version selection") either becomes lower, or even is no longer a dependency, then go modules thinks it was a manual override / upgrade.
That sometimes makes sense (if you indeed updated the version because you wanted a newer version) but sometimes you don't, and just remove all indirects to force it re-resolving the minimum versions can help find those.
- use containerd/api v1.8.0-rc.2 instead of relying on third_party directory - remove script to copy /api from containerd/containerd Signed-off-by: Akhil Mohan <[email protected]>
Signed-off-by: Akhil Mohan <[email protected]>
31e5bf7
to
076b07e
Compare
Signed-off-by: Akhil Mohan <[email protected]>
Signed-off-by: Akhil Mohan <[email protected]>
Signed-off-by: Akhil Mohan <[email protected]>
076b07e
to
3a487fd
Compare
/hold for containerd/typeurl#45 to merge |
d05e3dd
to
9aaa8d3
Compare
Signed-off-by: Akhil Mohan <[email protected]>
9aaa8d3
to
72387d4
Compare