-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
manager/allocator/cnmallocator: remove uses of deprecated Init() funcs
These functions were deprecated in moby/moby@28edc8e in favor of the Register functions. Unfortunately, not all Register functions have the same signature, so some (temporary) adaptor code was needed for these. Signed-off-by: Sebastiaan van Stijn <[email protected]>
- Loading branch information
Showing
4 changed files
with
40 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cnmallocator | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/docker/docker/libnetwork/driverapi" | ||
"github.com/docker/docker/libnetwork/drivers/remote" | ||
) | ||
|
||
type driverRegisterFn func(r driverapi.Registerer, config map[string]interface{}) error | ||
|
||
func registerRemote(r driverapi.Registerer, _ map[string]interface{}) error { | ||
dc, ok := r.(driverapi.DriverCallback) | ||
if !ok { | ||
return fmt.Errorf(`failed to register "remote" driver: driver does not implement driverapi.DriverCallback`) | ||
} | ||
return remote.Register(dc, dc.GetPluginGetter()) | ||
} | ||
|
||
//nolint:unused // is currently only used on Windows, but keeping these adaptors together in one file. | ||
func registerNetworkType(networkType string) func(dc driverapi.Registerer, config map[string]interface{}) error { | ||
return func(r driverapi.Registerer, _ map[string]interface{}) error { | ||
return RegisterManager(r, networkType) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters