Skip to content

Commit 8a9e482

Browse files
committed
Moved CNM specific logic to CNM package
1 parent 97c3f24 commit 8a9e482

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
SOURCEFILES = \
22
$(wildcard cni/*.go) \
3+
$(wildcard cni/ipam/*.go) \
4+
$(wildcard cni/network/*.go) \
5+
$(wildcard cni/plugin/*.go) \
36
$(wildcard cnm/*.go) \
7+
$(wildcard cnm/ipam/*.go) \
8+
$(wildcard cnm/network/*.go) \
9+
$(wildcard cnm/plugin/*.go) \
410
$(wildcard common/*.go) \
511
$(wildcard ebtables/*.go) \
612
$(wildcard ipam/*.go) \
@@ -9,9 +15,9 @@ SOURCEFILES = \
915
$(wildcard network/*.go) \
1016
$(wildcard store/*.go)
1117

12-
CNIDIR = cni
18+
CNMDIR = cnm/plugin
1319

14-
CNMDIR = cnm
20+
CNIDIR = cni/plugin
1521

1622
OUTPUTDIR = out
1723

cnm/plugin/api.go renamed to cnm/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright Microsoft Corp.
22
// All rights reserved.
33

4-
package plugin
4+
package cnm
55

66
const (
77
// Libnetwork remote plugin paths

cnm/ipam/ipam.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package ipam
66
import (
77
"net/http"
88

9-
"github.com/Azure/azure-container-networking/cnm/plugin"
9+
"github.com/Azure/azure-container-networking/cnm"
1010
"github.com/Azure/azure-container-networking/common"
1111
"github.com/Azure/azure-container-networking/ipam"
1212
"github.com/Azure/azure-container-networking/log"
@@ -23,7 +23,7 @@ const (
2323

2424
// IpamPlugin represents a CNM (libnetwork) IPAM plugin.
2525
type ipamPlugin struct {
26-
*plugin.Plugin
26+
*cnm.Plugin
2727
am ipam.AddressManager
2828
}
2929

@@ -34,7 +34,7 @@ type IpamPlugin interface {
3434
// NewPlugin creates a new IpamPlugin object.
3535
func NewPlugin(config *common.PluginConfig) (IpamPlugin, error) {
3636
// Setup base plugin.
37-
plugin, err := plugin.NewPlugin(name, config.Version, EndpointType)
37+
plugin, err := cnm.NewPlugin(name, config.Version, EndpointType)
3838
if err != nil {
3939
return nil, err
4040
}

cnm/network/network.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package network
66
import (
77
"net/http"
88

9-
"github.com/Azure/azure-container-networking/cnm/plugin"
9+
"github.com/Azure/azure-container-networking/cnm"
1010
"github.com/Azure/azure-container-networking/common"
1111
"github.com/Azure/azure-container-networking/log"
1212
"github.com/Azure/azure-container-networking/network"
@@ -22,7 +22,7 @@ const (
2222

2323
// NetPlugin represents a CNM (libnetwork) network plugin.
2424
type netPlugin struct {
25-
*plugin.Plugin
25+
*cnm.Plugin
2626
scope string
2727
nm network.NetworkManager
2828
}
@@ -34,7 +34,7 @@ type NetPlugin interface {
3434
// NewPlugin creates a new NetPlugin object.
3535
func NewPlugin(config *common.PluginConfig) (NetPlugin, error) {
3636
// Setup base plugin.
37-
plugin, err := plugin.NewPlugin(name, config.Version, endpointType)
37+
plugin, err := cnm.NewPlugin(name, config.Version, endpointType)
3838
if err != nil {
3939
return nil, err
4040
}

cnm/plugin/plugin.go renamed to cnm/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright Microsoft Corp.
22
// All rights reserved.
33

4-
package plugin
4+
package cnm
55

66
import (
77
"net/http"
File renamed without changes.

0 commit comments

Comments
 (0)