Unverified Commit 9037cadc authored by Menna Elmasry's avatar Menna Elmasry Committed by GitHub

Merge pull request #3320 from MonzElmasry/validate-go-mod-ci-1.19

[release-1.19]Add ci step to validate incorerct replacement fork
parents 7ab6d5cf d8826c25
......@@ -257,6 +257,28 @@ volumes:
---
kind: pipeline
name: validate_go_mods
platform:
os: linux
arch: amd64
steps:
- name: validate_go_mods
image: rancher/dapper:v0.5.0
commands:
- dapper -f Dockerfile.test.mod.dapper
volumes:
- name: docker
path: /var/run/docker.sock
volumes:
- name: docker
host:
path: /var/run/docker.sock
---
kind: pipeline
name: manifest
platform:
......
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"]
#!/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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment