NetworkOptionsManager types.NetworkOptionsManager is an interface for reading/setting networking options for containers based on the provided command flags.
| 122 | // NetworkOptionsManager types.NetworkOptionsManager is an interface for reading/setting networking |
| 123 | // options for containers based on the provided command flags. |
| 124 | type 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. |
| 152 | func NewNetworkingOptionsManager(globalOptions types.GlobalCommandOptions, netOpts types.NetworkOptions, client *containerd.Client) (NetworkOptionsManager, error) { |
no outgoing calls
no test coverage detected