MCPcopy Index your code
hub / github.com/containerd/nerdctl / NetworkOptionsManager

Interface NetworkOptionsManager

pkg/containerutil/container_network_manager.go:124–149  ·  view source on GitHub ↗

NetworkOptionsManager types.NetworkOptionsManager is an interface for reading/setting networking options for containers based on the provided command flags.

Source from the content-addressed store, hash-verified

122// NetworkOptionsManager types.NetworkOptionsManager is an interface for reading/setting networking
123// options for containers based on the provided command flags.
124type NetworkOptionsManager interface {
125 // NetworkOptions Returns a copy of the internal types.NetworkOptions.
126 NetworkOptions() types.NetworkOptions
127
128 // VerifyNetworkOptions Verifies that the internal network settings are correct.
129 VerifyNetworkOptions(context.Context) error
130
131 // SetupNetworking Performs setup actions required for the container with the given ID.
132 SetupNetworking(context.Context, string) error
133
134 // CleanupNetworking Performs any required cleanup actions for the given container.
135 // Should only be called to revert any setup steps performed in SetupNetworking.
136 CleanupNetworking(context.Context, containerd.Container) error
137
138 // InternalNetworkingOptionLabels Returns the set of NetworkingOptions which should be set as labels on the container.
139 //
140 // These options can potentially differ from the actual networking options
141 // that the NetworkOptionsManager was initially instantiated with.
142 // E.g: in container networking mode, the label will be normalized to an ID:
143 // `--net=container:myContainer` => `--net=container:<ID of myContainer>`.
144 InternalNetworkingOptionLabels(context.Context) (types.NetworkOptions, error)
145
146 // ContainerNetworkingOpts Returns a slice of `oci.SpecOpts` and `containerd.NewContainerOpts` which represent
147 // the network specs which need to be applied to the container with the given ID.
148 ContainerNetworkingOpts(context.Context, string) ([]oci.SpecOpts, []containerd.NewContainerOpts, error)
149}
150
151// NewNetworkingOptionsManager Returns a types.NetworkOptionsManager based on the provided command's flags.
152func NewNetworkingOptionsManager(globalOptions types.GlobalCommandOptions, netOpts types.NetworkOptions, client *containerd.Client) (NetworkOptionsManager, error) {

Callers 8

CreateFunction · 0.65
CreateFunction · 0.65
CreateFunction · 0.65
RemoveContainerFunction · 0.65
generateGcFuncFunction · 0.65
CreateFunction · 0.65
CreateFunction · 0.65

Implementers 4

cniNetworkManagerpkg/containerutil/container_network_ma
noneNetworkManagerpkg/containerutil/container_network_ma
containerNetworkManagerpkg/containerutil/container_network_ma
hostNetworkManagerpkg/containerutil/container_network_ma

Calls

no outgoing calls

Tested by

no test coverage detected