Skip to content

Commit

Permalink
fix broken CI (#823)
Browse files Browse the repository at this point in the history
* fix broken CI

* fix .travis.yml

* skip gomoqs

* fix multi arch image building
  • Loading branch information
murali-reddy committed Jan 22, 2020
1 parent f01a9a5 commit 53e0571
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
_output
_cache
Dockerfile.amd64.run
Dockerfile.arm64.run
Dockerfile.s390x.run
Dockerfile.arm.run
vendor/github.com/osrg/gobgp/gobgp/gobgp
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ go:
branches:
only:
- master
- /^bzub-.*$/
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
- /^PR\d*$/
- /.*/

env:
global:
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ ADD build/image-assets/profile /root/.profile
ADD build/image-assets/vimrc /root/.vimrc
ADD build/image-assets/motd-kube-router.sh /etc/motd-kube-router.sh
ADD kube-router gobgp /usr/local/bin/
RUN cd && \
/usr/local/bin/gobgp --gen-cmpl --bash-cmpl-file /var/lib/gobgp/gobgp-completion.bash

WORKDIR "/root"
ENTRYPOINT ["/usr/local/bin/kube-router"]
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ IS_ROOT=$(filter 0,$(shell id -u))
DOCKER=$(if $(or $(IN_DOCKER_GROUP),$(IS_ROOT),$(OSX)),docker,sudo docker)
MAKEFILE_DIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
UPSTREAM_IMPORT_PATH=$(GOPATH)/src/github.com/cloudnativelabs/kube-router/
BUILD_IN_DOCKER?=false
BUILD_IN_DOCKER?=true
DOCKER_BUILD_IMAGE?=golang:1.10.8-alpine3.9
ifeq ($(GOARCH), arm)
ARCH_TAG_PREFIX=$(GOARCH)
Expand Down Expand Up @@ -51,7 +51,7 @@ else
GOARCH=$(GOARCH) CGO_ENABLED=0 go build -ldflags '-X github.com/cloudnativelabs/kube-router/pkg/cmd.version=$(GIT_COMMIT) -X github.com/cloudnativelabs/kube-router/pkg/cmd.buildDate=$(BUILD_DATE)' -o kube-router cmd/kube-router/kube-router.go
endif

test: gofmt gomoqs ## Runs code quality pipelines (gofmt, tests, coverage, lint, etc)
test: gofmt ## Runs code quality pipelines (gofmt, tests, coverage, lint, etc)
ifeq "$(BUILD_IN_DOCKER)" "true"
$(DOCKER) run -v $(PWD):/go/src/github.com/cloudnativelabs/kube-router -w /go/src/github.com/cloudnativelabs/kube-router $(DOCKER_BUILD_IMAGE) \
sh -c 'go test -v -timeout 30s github.com/cloudnativelabs/kube-router/cmd/kube-router/ github.com/cloudnativelabs/kube-router/pkg/...'
Expand Down Expand Up @@ -148,8 +148,11 @@ release: push-release github-release ## Pushes a release to DockerHub and GitHub

clean: ## Removes the kube-router binary and Docker images
rm -f kube-router
$(DOCKER) rmi $(REGISTRY_DEV)

rm -f gobgp
rm -f Dockerfile.$(GOARCH).run
if [ $(shell $(DOCKER) images -q $(REGISTRY_DEV):$(IMG_TAG) 2> /dev/null) ]; then \
$(DOCKER) rmi $(REGISTRY_DEV):$(IMG_TAG); \
fi
gofmt: ## Tells you what files need to be gofmt'd.
@build/verify-gofmt.sh

Expand Down
9 changes: 8 additions & 1 deletion build/travis-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,27 @@ if [ "${TRAVIS_EVENT_TYPE}" = "pull_request" ]; then
fi
echo "Building/pushing PR$TRAVIS_PULL_REQUEST from $PR_USER"
make push IMG_TAG="PR$TRAVIS_PULL_REQUEST" GOARCH=amd64
make clean IMG_TAG="PR$TRAVIS_PULL_REQUEST" GOARCH=amd64
make push IMG_TAG="PR$TRAVIS_PULL_REQUEST" GOARCH=arm64
make clean IMG_TAG="PR$TRAVIS_PULL_REQUEST" GOARCH=arm64
make push IMG_TAG="PR$TRAVIS_PULL_REQUEST" GOARCH=arm
make clean IMG_TAG="PR$TRAVIS_PULL_REQUEST" GOARCH=arm
make push IMG_TAG="PR$TRAVIS_PULL_REQUEST" GOARCH=s390x
make clean IMG_TAG="PR$TRAVIS_PULL_REQUEST" GOARCH=s390x
exit 0
fi

# Release image tag format: v0.0.0 and latest
if [ -n "$TRAVIS_TAG" ]; then
echo "Running Release build on Travis"
make push-release RELEASE_TAG="amd64-$TRAVIS_TAG" GOARCH=amd64
make clean RELEASE_TAG="amd64-$TRAVIS_TAG" GOARCH=amd64
make push-release RELEASE_TAG="arm64-$TRAVIS_TAG" GOARCH=arm64
make clean RELEASE_TAG="arm64-$TRAVIS_TAG" GOARCH=arm64
make push-release RELEASE_TAG="arm-$TRAVIS_TAG" GOARCH=arm
make clean RELEASE_TAG="arm-$TRAVIS_TAG" GOARCH=arm
make push-release RELEASE_TAG="s390x-$TRAVIS_TAG" GOARCH=s390x

make clean RELEASE_TAG="s390x-$TRAVIS_TAG" GOARCH=s390x
echo "Pushing manifest on Travis"
make push-manifest RELEASE_TAG="$TRAVIS_TAG"
exit 0
Expand Down
2 changes: 1 addition & 1 deletion cmd/kube-router/kube-router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestMainHelp(t *testing.T) {
exp = append(exp, []byte("```\n")...)

if !bytes.Contains(docBuf.Bytes(), exp) {
t.Errorf("docs/README.md 'command line options' section does not match `kube-router --help`.\nExpected:\n%s", exp)
t.Errorf("docs/user-guide.md 'command line options' section does not match `kube-router --help`.\nExpected:\n%s", exp)
t.Errorf("\nGot:\n%s", docBuf.Bytes())
}
}
2 changes: 1 addition & 1 deletion docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ Usage of kube-router:
--iptables-sync-period duration The delay between iptables rule synchronizations (e.g. '5s', '1m'). Must be greater than 0. (default 5m0s)
--ipvs-graceful-period duration The graceful period before removing destinations from IPVS services (e.g. '5s', '1m', '2h22m'). Must be greater than 0. (default 30s)
--ipvs-graceful-termination Enables the experimental IPVS graceful terminaton capability
--ipvs-permit-all Enables rule to accept all incoming traffic to service VIP's on the node. (default true)
--ipvs-sync-period duration The delay between ipvs config synchronizations (e.g. '5s', '1m', '2h22m'). Must be greater than 0. (default 5m0s)
--ipvs-permit-all Permit all inbound traffic to the service VIP's
--kubeconfig string Path to kubeconfig file with authorization information (the master location is set by the master flag).
--masquerade-all SNAT all traffic to cluster IP/node port.
--master string The address of the Kubernetes API server (overrides any value in kubeconfig).
Expand Down
Binary file removed vendor/github.com/osrg/gobgp/gobgp/gobgp
Binary file not shown.

0 comments on commit 53e0571

Please sign in to comment.