(opts *handlerOpts)
| 372 | } |
| 373 | |
| 374 | func getIPAddressOpts(opts *handlerOpts) ([]cni.NamespaceOpts, error) { |
| 375 | if opts.containerIP != "" { |
| 376 | if rootlessutil.IsRootlessChild() { |
| 377 | log.L.Debug("container IP assignment is not fully supported in rootless mode. The IP is not accessible from the host (but still accessible from other containers).") |
| 378 | } |
| 379 | |
| 380 | return []cni.NamespaceOpts{ |
| 381 | cni.WithLabels(map[string]string{ |
| 382 | // Special tick for go-cni. Because go-cni marks all labels and args as same |
| 383 | // So, we need add a special label to pass the containerIP to the host-local plugin. |
| 384 | // FYI: https://github.com/containerd/go-cni/blob/v1.1.3/README.md?plain=1#L57-L64 |
| 385 | "IgnoreUnknown": "1", |
| 386 | }), |
| 387 | cni.WithArgs("IP", opts.containerIP), |
| 388 | }, nil |
| 389 | } |
| 390 | return nil, nil |
| 391 | } |
| 392 | |
| 393 | func getMACAddressOpts(opts *handlerOpts) ([]cni.NamespaceOpts, error) { |
| 394 | if opts.containerMAC != "" { |
no test coverage detected
searching dependent graphs…