greenpau / cni-plugins

CNI Plugins compatible with nftables
Apache License 2.0
48 stars 13 forks source link

fedora build issues #8

Closed ghost closed 3 years ago

ghost commented 3 years ago

fedora 33 with golang-bin, what golang devel packages do I need?

$go get -u github.com/greenpau/cni-plugins/cmd/cni-nftables-portmap
cannot find package "github.com/containernetworking/cni/pkg/types/current" in any of:
    /usr/lib/golang/src/github.com/containernetworking/cni/pkg/types/current (from $GOROOT)
    /home/louisgtwo/go/src/github.com/containernetworking/cni/pkg/types/current (from $GOPATH)
$go get -u github.com/greenpau/cni-plugins/cmd/cni-nftables-firewall
cannot find package "github.com/containernetworking/cni/pkg/types/current" in any of:
    /usr/lib/golang/src/github.com/containernetworking/cni/pkg/types/current (from $GOROOT)
    /home/louisgtwo/go/src/github.com/containernetworking/cni/pkg/types/current (from $GOPATH)
greenpau commented 3 years ago

@louisgtwo , try running the below commands. I suspect you have a cached version somewhere.

go clean -cache -modcache -i -r
go get -u github.com/greenpau/cni-plugins/cmd/cni-nftables-portmap@v1.0.6
go get -u github.com/greenpau/cni-plugins/cmd/cni-nftables-firewall@v1.0.6

Also, please post back your go version and environment:

go version
go env
ghost commented 3 years ago

$ go get -u github.com/greenpau/cni-plugins/cmd/cni-nftables-portmap@v1.0.6 go: cannot use path@version syntax in GOPATH mode

$ go version go version go1.15.8 linux/amd64

$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/louisgtwo/.cache/go-build" GOENV="/home/louisgtwo/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/louisgtwo/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/louisgtwo/go" GOPRIVATE="" GOPROXY="direct" GOROOT="/usr/lib/golang" GOSUMDB="off" GOTMPDIR="" GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build280175787=/tmp/go-build -gno-record-gcc-switches"

greenpau commented 3 years ago

@louisgtwo , see how the error is go: cannot use path@version syntax in GOPATH mode.

Basically you need to switch from GOPATH mode.

Try and report back.

GO111MODULE=on go get -u github.com/greenpau/cni-plugins/cmd/cni-nftables-portmap@v1.0.6
ghost commented 3 years ago

That did the trick, Thanks. Second problem fedora does not have /usr/local/lib/cni or /usr/lib/cni. Where do I mv these to?

ghost commented 3 years ago

Fedora has this dir. Is this the right place? $ ls /usr/libexec/cni/ bandwidth bridge dhcp dnsname firewall flannel host-device host-local ipvlan loopback macvlan portmap ptp sample sbr static tuning vlan vrf

greenpau commented 3 years ago

Fedora has this dir. Is this the right place?

By default, CNI binaries are located in the following directories:

I would say put them in /usr/local/lib/cni