Skip to content

Use typeurl.Any instead of github.com/gogo/protobuf/types.Any#6706

Merged
estesp merged 1 commit intocontainerd:mainfrom
kzys:typeurl-upgrade
Mar 25, 2022
Merged

Use typeurl.Any instead of github.com/gogo/protobuf/types.Any#6706
estesp merged 1 commit intocontainerd:mainfrom
kzys:typeurl-upgrade

Conversation

@kzys
Copy link
Copy Markdown
Member

@kzys kzys commented Mar 21, 2022

This commit upgrades github.com/containerd/typeurl to use typeurl.Any.
The interface hides gogo/protobuf/types.Any from containerd's Go client.

Signed-off-by: Kazuyoshi Kato [email protected]

@k8s-ci-robot
Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kzys kzys force-pushed the typeurl-upgrade branch from 7364675 to e8e7e5f Compare March 21, 2022 16:51
@kzys
Copy link
Copy Markdown
Member Author

kzys commented Mar 21, 2022

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 21, 2022

Build succeeded.

@dmcgowan
Copy link
Copy Markdown
Member

@kzys yeah, that is a good idea

@dmcgowan
Copy link
Copy Markdown
Member

Much simpler containerd/typeurl#32

@kzys kzys force-pushed the typeurl-upgrade branch 4 times, most recently from db2b205 to 18212ad Compare March 22, 2022 02:03
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 22, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch from 18212ad to 44852c2 Compare March 22, 2022 02:35
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 22, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch from 44852c2 to 51b1947 Compare March 22, 2022 04:13
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 22, 2022

Build succeeded.

@kzys
Copy link
Copy Markdown
Member Author

kzys commented Mar 22, 2022

@kzys kzys force-pushed the typeurl-upgrade branch from 51b1947 to a4642f8 Compare March 22, 2022 04:53
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 22, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch from a4642f8 to 6d69401 Compare March 22, 2022 05:31
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 22, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch 3 times, most recently from 36512bc to 8a586e4 Compare March 22, 2022 07:06
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 22, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch from 8a586e4 to 277a641 Compare March 22, 2022 07:31
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 22, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch 2 times, most recently from c285162 to cf17c36 Compare March 22, 2022 13:43
Comment on lines 47 to 50
// typeurl.MarshalAny currently returns &types.Any, but it will
// return typeurl.Any soon.
pbany := &types.Any{
TypeUrl: any.GetTypeUrl(),
Value: any.GetValue(),
}

for _, id := range imgcrypt.PayloadToolIDs {
c.ProcessorPayloads[id] = any
c.ProcessorPayloads[id] = pbany
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the local change I made. If that looks okay, I'm going to open a PR against imgcrypt.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Opened containerd/imgcrypt#72.

Comment thread container.go
return nil, err
}
request.Options = any
request.Options = protobuf.FromAny(any)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request (CreateTaskRequest) is generated from a proto. So we have to call FromAny() here.

@kzys kzys force-pushed the typeurl-upgrade branch 2 times, most recently from 3089cc6 to c9a0904 Compare March 23, 2022 02:36
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 23, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch 3 times, most recently from 7cae71d to 231128c Compare March 23, 2022 17:55
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 23, 2022

Build succeeded.

@kzys kzys marked this pull request as ready for review March 23, 2022 18:18
@kzys kzys force-pushed the typeurl-upgrade branch from 231128c to 7d58ad8 Compare March 23, 2022 19:04
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 23, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch from 5153484 to 4923954 Compare March 23, 2022 21:01
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 23, 2022

Build succeeded.

@kzys kzys marked this pull request as draft March 23, 2022 21:39
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 23, 2022

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 24, 2022

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 24, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch from d7ca9d1 to 9174646 Compare March 24, 2022 01:01
@kzys kzys marked this pull request as ready for review March 24, 2022 01:04
@kzys
Copy link
Copy Markdown
Member Author

kzys commented Mar 24, 2022

This is finally ready for review! While there are still gogo/protobuf's Any here and there, I don't want to increase the size of this PR anymore.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 24, 2022

Build succeeded.

Comment thread container_checkpoint_opts.go
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 24, 2022

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 24, 2022

Build succeeded.

@kzys kzys force-pushed the typeurl-upgrade branch from 0a30611 to fa69a5c Compare March 24, 2022 20:49
This commit upgrades github.com/containerd/typeurl to use typeurl.Any.
The interface hides gogo/protobuf/types.Any from containerd's Go client.

Signed-off-by: Kazuyoshi Kato <[email protected]>
@kzys kzys force-pushed the typeurl-upgrade branch from fa69a5c to 96b16b4 Compare March 24, 2022 20:50
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 24, 2022

Build succeeded.

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit 3633cae into containerd:main Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants