Skip to content

Commit

Permalink
backport of commit 4c9f476 (#12687)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Lefebvre <tlefebvre@cloudflare.com>
  • Loading branch information
hc-github-team-nomad-core and th0m authored Apr 19, 2022
1 parent 9d79397 commit 4a1656f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions drivers/mock/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,10 @@ func (d *Driver) GetHandle(taskID string) *taskHandle {
return h
}

func (d *Driver) CreateNetwork(allocID string) (*drivers.NetworkIsolationSpec, error) {
return nil, nil
var _ drivers.DriverNetworkManager = (*Driver)(nil)

func (d *Driver) CreateNetwork(allocID string, request *drivers.NetworkCreateRequest) (*drivers.NetworkIsolationSpec, bool, error) {
return nil, true, nil
}

func (d *Driver) DestroyNetwork(allocID string, spec *drivers.NetworkIsolationSpec) error {
Expand Down
4 changes: 3 additions & 1 deletion plugins/drivers/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,9 @@ func (d *driverPluginClient) ExecTaskStreamingRaw(ctx context.Context,
}
}

func (d *driverPluginClient) CreateNetwork(allocID string) (*NetworkIsolationSpec, bool, error) {
var _ DriverNetworkManager = (*driverPluginClient)(nil)

func (d *driverPluginClient) CreateNetwork(allocID string, _ *NetworkCreateRequest) (*NetworkIsolationSpec, bool, error) {
req := &proto.CreateNetworkRequest{
AllocId: allocID,
}
Expand Down

0 comments on commit 4a1656f

Please sign in to comment.