mirror of https://github.com/k3s-io/k3s
Merge pull request #3270 from MonzElmasry/validate-go-mod-ci
Add ci step to validate incorrect replacement forkpull/3290/head
commit
17d91c5148
@ -0,0 +1,11 @@
|
||||
ARG GOLANG=golang:1.16.2-alpine3.12
|
||||
FROM ${GOLANG}
|
||||
|
||||
RUN apk -U --no-cache add bash jq
|
||||
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
|
||||
ENV HOME ${DAPPER_SOURCE}
|
||||
WORKDIR ${DAPPER_SOURCE}
|
||||
|
||||
COPY ./scripts/test-mods /bin/
|
||||
|
||||
ENTRYPOINT ["/bin/test-mods"]
|
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e -x
|
||||
|
||||
res=$(go mod edit --json | jq '.Replace[] | select(.Old.Path | contains("k8s.io/")) | .New.Path' | grep -v k3s-io | wc -l)
|
||||
if [ $res -gt 0 ];then
|
||||
echo "Incorrect kubernetes replacement fork in go.mod"
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
Loading…
Reference in new issue