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 authored and rhatdan committed Nov 24, 2020
1 parent 4ebd9d9 commit 3bbb42a
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 @@ -30,7 +30,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 3bbb42a

Please sign in to comment.