Skip to content

Commit fd3f09a

Browse files
committed
network: remove extra/libnetwork
remove extra/libnetwork Signed-off-by: Rudy Zhang <[email protected]>
1 parent 9de6fb6 commit fd3f09a

File tree

1,278 files changed

+11
-332236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,278 files changed

+11
-332236
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
GOBUILD=go build
33
GOCLEAN=go clean
44
GOTEST=go test
5-
GOPACKAGES=$(shell go list ./... | grep -v /vendor/ | grep -v /extra/ | sed 's/^_//')
5+
GOPACKAGES=$(shell go list ./... | grep -v /vendor/ | sed 's/^_//')
66

77
# Binary name of CLI and Daemon
88
BINARY_NAME=pouchd
@@ -45,18 +45,18 @@ check: pre fmt lint vet validate-swagger
4545
fmt: ## run go fmt
4646
@echo $@
4747
@which gofmt
48-
@test -z "$$(gofmt -s -l . 2>/dev/null | grep -Fv 'vendor/' | grep -Fv 'extra/' | grep -v ".pb.go$$" | tee /dev/stderr)" || \
48+
@test -z "$$(gofmt -s -l . 2>/dev/null | grep -Fv 'vendor/' | grep -v ".pb.go$$" | tee /dev/stderr)" || \
4949
(echo "please format Go code with 'gofmt -s -w'" && false)
50-
@test -z "$$(find . -path ./vendor -prune -o ! -path ./extra -prune -o ! -name timestamp.proto ! -name duration.proto -name '*.proto' -type f -exec grep -Hn -e "^ " {} \; | tee /dev/stderr)" || \
50+
@test -z "$$(find . -path ./vendor -prune -o ! -name timestamp.proto ! -name duration.proto -name '*.proto' -type f -exec grep -Hn -e "^ " {} \; | tee /dev/stderr)" || \
5151
(echo "please indent proto files with tabs only" && false)
52-
@test -z "$$(find . -path ./vendor -prune -o ! -path ./extra -prune -o -name '*.proto' -type f -exec grep -Hn "Meta meta = " {} \; | grep -v '(gogoproto.nullable) = false' | tee /dev/stderr)" || \
52+
@test -z "$$(find . -path ./vendor -prune -o ! -name '*.proto' -type f -exec grep -Hn "Meta meta = " {} \; | grep -v '(gogoproto.nullable) = false' | tee /dev/stderr)" || \
5353
(echo "meta fields in proto files must have option (gogoproto.nullable) = false" && false)
5454

5555
.PHONY: lint
5656
lint: ## run go lint
5757
@echo $@
5858
@which golint
59-
@test -z "$$(golint ./... | grep -Fv 'vendor/' | grep -Fv 'extra' | grep -v ".pb.go:" | tee /dev/stderr)"
59+
@test -z "$$(golint ./... | grep -Fv 'vendor/' | grep -v ".pb.go:" | tee /dev/stderr)"
6060

6161
.PHONY: vet
6262
vet: # run go vet

daemon/mgr/network.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"net"
77
"path"
88
"strings"
9-
"time"
109

1110
apitypes "github.com/alibaba/pouch/apis/types"
1211
"github.com/alibaba/pouch/daemon/config"
@@ -16,7 +15,6 @@ import (
1615
"github.com/alibaba/pouch/pkg/meta"
1716
"github.com/alibaba/pouch/pkg/randomid"
1817

19-
netlog "github.com/Sirupsen/logrus"
2018
"github.com/docker/go-connections/nat"
2119
"github.com/docker/libnetwork"
2220
nwconfig "github.com/docker/libnetwork/config"
@@ -70,8 +68,6 @@ func NewNetworkManager(cfg *config.Config, store *meta.Store, ctrMgr ContainerMg
7068
cfg.NetworkConfg.MetaPath = path.Dir(store.BaseDir)
7169
cfg.NetworkConfg.ExecRoot = network.DefaultExecRoot
7270

73-
initNetworkLog(cfg)
74-
7571
// get active sandboxes
7672
ctrs, err := ctrMgr.List(context.Background(),
7773
func(c *Container) bool {
@@ -484,7 +480,7 @@ func networkOptions(create apitypes.NetworkCreateConfig) ([]libnetwork.NetworkOp
484480
nwOptions = append(nwOptions, libnetwork.NetworkOptionDriverOpts(networkCreate.Options))
485481

486482
if create.Name == "ingress" {
487-
nwOptions = append(nwOptions, libnetwork.NetworkOptionIngress())
483+
nwOptions = append(nwOptions, libnetwork.NetworkOptionIngress(true))
488484
}
489485

490486
if networkCreate.Internal {
@@ -537,20 +533,6 @@ func (nm *NetworkManager) getNetworkSandbox(id string) libnetwork.Sandbox {
537533
return sb
538534
}
539535

540-
// libnetwork's logrus version is different from pouchd,
541-
// so we need to set libnetwork's logrus addintionly.
542-
func initNetworkLog(cfg *config.Config) {
543-
if cfg.Debug {
544-
netlog.SetLevel(netlog.DebugLevel)
545-
}
546-
547-
formatter := &netlog.TextFormatter{
548-
FullTimestamp: true,
549-
TimestampFormat: time.RFC3339Nano,
550-
}
551-
netlog.SetFormatter(formatter)
552-
}
553-
554536
func endpointOptions(n libnetwork.Network, endpoint *types.Endpoint) ([]libnetwork.EndpointOption, error) {
555537
var createOptions []libnetwork.EndpointOption
556538
epConfig := endpoint.EndpointConfig

docs/test/test.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ The following steps are also needed to make sure libnetwork package could be fou
9999

100100
```
101101
BUILDPATH=/tmp/pouchbuild
102-
mkdir -p $BUILDPATH/src/github.com/docker
103-
cp -r /go/src/github.com/alibaba/pouch/extra/libnetwork $BUILDPATH/src/github.com/docker/libnetwork
104-
export GOPATH=$GOPATH:$BUILDPATH:$BUILDPATH/src/github.com/docker/libnetwork/Godeps/_workspace
102+
export GOPATH=$GOPATH:$BUILDPATH
105103
```
106104

107105
And please notice that files in `/tmp` directory may be deleted after reboot.

extra/libnetwork/.dockerignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

extra/libnetwork/.gitignore

Lines changed: 0 additions & 39 deletions
This file was deleted.

extra/libnetwork/CHANGELOG.md

Lines changed: 0 additions & 199 deletions
This file was deleted.

extra/libnetwork/Dockerfile.build

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)