Skip to content

Commit

Permalink
backport of commit 9d700eb
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 committed Apr 18, 2023
1 parent 4f6e014 commit 3ee852d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .changelog/16921.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```release-note:bug
client: Prevent a panic when starting jobs without task group network
client: Prevent a panic when an allocation has a legacy task-level bridge network and uses a driver that does not create a network namespace
```
26 changes: 26 additions & 0 deletions client/allocrunner/network_manager_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,32 @@ func TestNewNetworkManager(t *testing.T) {
err: true,
errContains: "hostname is not currently supported on driver group1",
},
{
name: "legacy task network using exec and bridge",
alloc: &structs.Allocation{
TaskGroup: "group",
Job: &structs.Job{
TaskGroups: []*structs.TaskGroup{
{
Name: "group",
Tasks: []*structs.Task{
{
Name: "task1",
Driver: "group1",
Resources: &structs.Resources{
Networks: []*structs.NetworkResource{
{Mode: "bridge"},
},
},
},
},
},
},
},
},
mustInit: false,
err: false,
},
} {
t.Run(tc.name, func(t *testing.T) {
require := require.New(t)
Expand Down

0 comments on commit 3ee852d

Please sign in to comment.