mirror of https://github.com/k3s-io/k3s
Add CNI Plugins and Flannel version to build scripts
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>pull/5518/head
parent
418c3fa858
commit
1caae63140
|
@ -13,6 +13,7 @@ PKG_K3S_CONTAINERD="github.com/k3s-io/containerd"
|
|||
PKG_CRICTL="github.com/kubernetes-sigs/cri-tools/pkg"
|
||||
PKG_K8S_BASE="k8s.io/component-base"
|
||||
PKG_K8S_CLIENT="k8s.io/client-go/pkg"
|
||||
PKG_CNI_PLUGINS="github.com/containernetworking/plugins"
|
||||
|
||||
buildDate=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
|
||||
|
||||
|
@ -35,8 +36,11 @@ VERSIONFLAGS="
|
|||
-X ${PKG_CONTAINERD}/version.Version=${VERSION_CONTAINERD}
|
||||
-X ${PKG_CONTAINERD}/version.Package=${PKG_K3S_CONTAINERD}
|
||||
|
||||
-X ${PKG_CONTAINERD}/version.Version=${VERSION_CONTAINERD}
|
||||
-X ${PKG_CONTAINERD}/version.Package=${PKG_K3S_CONTAINERD}
|
||||
-X ${PKG_CNI_PLUGINS}/pkg/utils/buildversion.BuildVersion=${VERSION_CNIPLUGINS}
|
||||
-X ${PKG_CNI_PLUGINS}/plugins/meta/flannel.Program=flannel
|
||||
-X ${PKG_CNI_PLUGINS}/plugins/meta/flannel.Version=${VERSION_FLANNEL}
|
||||
-X ${PKG_CNI_PLUGINS}/plugins/meta/flannel.Commit=${COMMIT}
|
||||
-X ${PKG_CNI_PLUGINS}/plugins/meta/flannel.buildDate=${buildDate}
|
||||
"
|
||||
LDFLAGS="
|
||||
-w -s"
|
||||
|
@ -101,7 +105,7 @@ if [ ! -x ${INSTALLBIN}/cni ]; then
|
|||
WORKDIR=$TMPDIR/src/github.com/containernetworking/plugins
|
||||
git clone -b $VERSION_CNIPLUGINS https://github.com/rancher/plugins.git $WORKDIR
|
||||
cd $WORKDIR
|
||||
GO111MODULE=off GOPATH=$TMPDIR CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -ldflags "$LDFLAGS $STATIC" -o $INSTALLBIN/cni
|
||||
GO111MODULE=off GOPATH=$TMPDIR CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o $INSTALLBIN/cni
|
||||
)
|
||||
fi
|
||||
|
||||
|
|
|
@ -42,7 +42,12 @@ if [ -z "$VERSION_RUNC" ]; then
|
|||
VERSION_RUNC="v0.0.0"
|
||||
fi
|
||||
|
||||
VERSION_CNIPLUGINS="v1.0.1-k3s1"
|
||||
VERSION_FLANNEL=$(grep github.com/flannel-io/flannel go.mod | head -n1 | awk '{print $2}')
|
||||
if [ -z "$VERSION_FLANNEL" ]; then
|
||||
VERSION_FLANNEL="v0.0.0"
|
||||
fi
|
||||
|
||||
VERSION_CNIPLUGINS="v1.1.1-k3s1"
|
||||
|
||||
VERSION_ROOT="v0.11.0"
|
||||
|
||||
|
|
Loading…
Reference in New Issue