Skip to content

Commit

Permalink
fix make all target
Browse files Browse the repository at this point in the history
We need to properly set GO flags and also to not run checks on
generated directories.
  • Loading branch information
phoracek committed Feb 14, 2020
1 parent 7601bd6 commit cfd4fcb
Show file tree
Hide file tree
Showing 40 changed files with 89 additions and 10,477 deletions.
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ TARGETS = \
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))

# Gather needed source files and directories to create target dependencies
directories := $(filter-out ./ ./vendor/ ,$(sort $(dir $(wildcard ./*/))))
directories=$(filter-out ./ ./vendor/ ./_out/ ./_kubevirtci/ ,$(sort $(dir $(wildcard ./*/))))
all_sources=$(call rwildcard,$(directories),*) $(filter-out $(TARGETS), $(wildcard *))
go_sources=$(call rwildcard,cmd/,*.go) $(call rwildcard,pkg/,*.go) $(call rwildcard,test/,*.go)

# Configure Go
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on
export GOFLAGS=-mod=vendor

.ONESHELL:

Expand All @@ -24,11 +32,11 @@ check: goimports-check whitespace-check vet test/unit

format: goimports-format whitespace-format

goimports-check: $(all_sources)
goimports-check: $(go_sources)
go run ./vendor/golang.org/x/tools/cmd/goimports -d ./pkg ./cmd ./test
touch $@

goimports-format: $(all_sources)
goimports-format: $(go_sources)
go run ./vendor/golang.org/x/tools/cmd/goimports -w ./pkg ./cmd ./test
touch $@

Expand All @@ -40,7 +48,7 @@ whitespace-format: $(all_sources)
go run ./vendor/golang.org/x/tools/cmd/goimports -w ./pkg ./cmd ./test
touch $@

vet: $(all_sources)
vet: $(go_sources)
go vet ./pkg/... ./cmd/... ./test/...
touch $@

Expand Down
4 changes: 0 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@ module github.com/kubevirt/macvtap-cni
go 1.13

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/client9/misspell v0.3.4 // indirect
github.com/containernetworking/plugins v0.8.5
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/kubevirt/device-plugin-manager v1.14.0
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.8.1
github.com/vishvananda/netlink v1.1.0
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 // indirect
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc
golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9
google.golang.org/grpc v1.26.0
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc // indirect
k8s.io/client-go v0.0.0
k8s.io/kubernetes v0.0.0-00010101000000-000000000000
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/deviceplugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
const (
tapPath = "/dev/tap"
// Interfaces will be named as <Name><suffix>[0-<Capacity>]
suffix = "Mvp"
suffix = "Mvp"
defaultCapacity = 100
)

Expand Down Expand Up @@ -50,7 +50,7 @@ func (mdp *MacvtapDevicePlugin) generateMacvtapDevices() []*pluginapi.Device {
Health: pluginapi.Healthy,
})
}

return macvtapDevs
}

Expand Down
Loading

0 comments on commit cfd4fcb

Please sign in to comment.