Skip to content
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

spec,libcni: add metadata field to Interface struct for CNI Result #1051

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ Plugins must output a JSON object with the following keys upon a successful `ADD
- `sandbox` (string): The isolation domain reference (e.g. path to network namespace) for the interface, or empty if on the host. For interfaces created inside the container, this should be the value passed via `CNI_NETNS`.
- `socketPath` (string, optional): An absolute path to a socket file corresponding to this interface, if applicable.
- `pciID` (string, optional): The platform-specific identifier of the PCI device corresponding to this interface, if applicable.
- `metadata`: a dictionary consisting of interface configurion information.
- `ips`: IPs assigned by this attachment. Plugins may include IPs assigned external to the container.
- `address` (string): an IP address in CIDR notation (eg "192.168.1.3/24").
- `gateway` (string): the default gateway for this subnet, if one exists.
Expand Down
1 change: 1 addition & 0 deletions pkg/types/100/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,12 @@

// Interface contains values about the created interfaces
type Interface struct {
Name string `json:"name"`

Check failure on line 271 in pkg/types/100/types.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gci`-ed with --skip-generated -s standard,default,prefix(github.com/containernetworking) (gci)
Mac string `json:"mac,omitempty"`
Sandbox string `json:"sandbox,omitempty"`
SocketPath string `json:"socketPath,omitempty"`
PciID string `json:"pciID,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}

func (i *Interface) String() string {
Expand Down
1 change: 1 addition & 0 deletions pkg/types/100/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
Sandbox: "/proc/3553/ns/net",
PciID: "8086:9a01",
SocketPath: "/path/to/vhost/fd",
Metadata: make(map[string]string),

Check failure on line 58 in pkg/types/100/types_test.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gci`-ed with --skip-generated -s standard,default,prefix(github.com/containernetworking) (gci)
},
},
IPs: []*current.IPConfig{
Expand Down
1 change: 1 addition & 0 deletions pkg/types/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
Sandbox: "/proc/3553/ns/net",
PciID: "8086:9a01",
SocketPath: "/path/to/vhost/fd",
Metadata: make(map[string]string),

Check failure on line 172 in pkg/types/types_test.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gci`-ed with --skip-generated -s standard,default,prefix(github.com/containernetworking) (gci)
},
},
IPs: []*current.IPConfig{
Expand Down
Loading