Skip to content

Commit

Permalink
Enable support for CNI mode networks for Consul Connect
Browse files Browse the repository at this point in the history
  • Loading branch information
sundbry committed Nov 9, 2023
1 parent 1212a37 commit 23aedb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nomad/job_endpoint_hook_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,10 @@ func groupConnectSidecarValidate(g *structs.TaskGroup, s *structs.Service) error
return fmt.Errorf("Consul Connect sidecars require exactly 1 network, found %d in group %q", n, g.Name)
}

if g.Networks[0].Mode != "bridge" {
return fmt.Errorf("Consul Connect sidecar requires bridge network, found %q in group %q", g.Networks[0].Mode, g.Name)
mode := g.Networks[0].Mode

if mode != "bridge" && !strings.HasPrefix(mode, "cni/") {
return fmt.Errorf("Consul Connect sidecar requires a bridge or CNI network, found %q in group %q", g.Networks[0].Mode, g.Name)
}

// We must enforce lowercase characters on group and service names for connect
Expand Down

0 comments on commit 23aedb6

Please sign in to comment.