This repository was archived by the owner on May 12, 2021. It is now read-only.
virtcontainers: Rely on new interface LinkType field#867
Merged
sboeuf merged 4 commits intokata-containers:masterfrom Nov 5, 2018
Merged
virtcontainers: Rely on new interface LinkType field#867sboeuf merged 4 commits intokata-containers:masterfrom
sboeuf merged 4 commits intokata-containers:masterfrom
Conversation
Author
|
/test |
Author
|
/test |
Member
Author
|
/test |
Author
Member
|
LGTM! Thanks @sboeuf ! |
Author
|
@amshinde @jodh-intel PTAL |
Author
|
/test |
WeiZhang555
reviewed
Nov 2, 2018
virtcontainers/pkg/types/types.go
Outdated
| Gateway string `json:"gateway,omitempty"` | ||
| Device string `json:"device,omitempty"` | ||
| Source string `json:"source,omitempty"` | ||
| Scope uint32 `json:"scope,omitempty"` |
Member
There was a problem hiding this comment.
We can remove all json tags "json:"scope,omitempty"" because these types in this file will never be marshaled to json format, agent/pkg/types is the json format data.
So I think it's better to remove these json tags incase it gives code reader wrong hints that it's the json protocol filed.
Member
|
One comment, other parts LGTM. I love the new package |
added 4 commits
November 2, 2018 08:46
Instead of relying on the kata agent to define generic structures, the logic is to define those as virtcontainers "types" package. This way, all consumers of those structures, such as kata-runtime, kata-netmon, and kata-containerd-shim, don't have to import some dependency from the kata-agent. Fixes kata-containers#876 Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit replaces every place where the "types" package from the Kata agent was used, with the new "types" package from virtcontainers. In order to do so, it introduces a few translation functions between the agent and virtcontainers types, since this is needed by the kata agent implementation. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
In order to provide the right information about the interface that needs to be added, kata-netmon provisions the new field LinkType of the Interface structure. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Now that Interface structure includes the useful information about the type of interface, Kata does not need to do any assumption about the type of interface that needs to be added. Fixes kata-containers#866 Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Author
|
/test |
Author
|
@WeiZhang555 changes applied :) |
Member
3 tasks
Author
|
The metrics CI is down here. Let's move forward and merge this PR as it got 3 approvals already. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The logic wants that virtcontainers should be the place where the common packages should be defined. This pull request takes care of defining generic network structures into a new package
pkg/types/types.go, which is basically a duplication of what is defined by the agent. But this allows virtcontainers and its consumers (kata-runtime, kata-netmon, kata-containerd-shim) to be independent from the agent.Based on the new package that define a new field
LinkTypefor the structureInterface, Kata does not need anymore to do any assumption about the type of interface that needs to be added.Fixes #866
Fixes #876