Skip to content

Commit

Permalink
Static IP and MAC addresses are allowed in rootless CNI
Browse files Browse the repository at this point in the history
Loosen some restrictions within specgen around rootless
containers - they can now set static IP and MAC addresses as long
as they are in a CNI network.

Fixes containers#7842

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
  • Loading branch information
mheon committed Oct 30, 2020
1 parent 228396a commit c265403
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/specgen/container_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func exclusiveOptions(opt1, opt2 string) error {
// input for creating a container.
func (s *SpecGenerator) Validate() error {

if rootless.IsRootless() {
if rootless.IsRootless() && len(s.CNINetworks) == 0 {
if s.StaticIP != nil || s.StaticIPv6 != nil {
return ErrNoStaticIPRootless
}
Expand Down

0 comments on commit c265403

Please sign in to comment.