Skip to content

Commit

Permalink
fix: local development minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gvicentin committed Aug 28, 2024
1 parent 9eecf81 commit 6aca766
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG alpine_version=3.19
ARG golang_version=1.20
ARG golang_version=1.22
FROM --platform=$BUILDPLATFORM golang:${golang_version}-alpine${alpine_version} as builder
ARG TARGETARCH
ENV GOARCH=$TARGETARCH
Expand Down
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
BINARY=kubernetes-router
TAG=latest
IMAGE=tsuru/$(BINARY)
LOCAL_REGISTRY=10.200.10.1:5000
NAMESPACE=tsuru
LOCAL_REGISTRY=100.64.100.100:5000
NAMESPACE=tsuru-system
LINTER_ARGS = \
-j 4 --enable-gc -s vendor -e '.*/vendor/.*' --vendor --enable=misspell --enable=gofmt --enable=goimports \
--disable=gocyclo --disable=gosec --deadline=60m --tests
RUN_FLAGS=-v 9

# When using Podman, set DOCKER=podman
DOCKER ?= docker

.PHONY: run
run: build
./$(BINARY) $(RUN_FLAGS)
Expand All @@ -18,11 +21,12 @@ build:

.PHONY: build-docker
build-docker:
docker build --rm -t $(IMAGE):$(TAG) .
$(DOCKER) build --rm -t $(IMAGE):$(TAG) .

.PHONY: push
push: build-docker
docker push $(IMAGE):$(TAG)
# $(DOCKER) push $(IMAGE):$(TAG) --tls-verify=false
$(DOCKER) push $(IMAGE):$(TAG)

.PHONY: test
test:
Expand All @@ -31,8 +35,6 @@ test:
.PHONY: lint
lint:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin
go install ./...
go test -i ./...
$$(go env GOPATH)/bin/golangci-lint run -c ./.golangci.yml ./...

.PHONY: minikube
Expand Down
2 changes: 1 addition & 1 deletion deployments/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
scheme: HTTP
timeoutSeconds: 5
command: ["./kubernetes-router"]
args: ["-v", "3", "--k8s-namespace", "NAMESPACE"]
args: ["-v", "3", "--k8s-namespace", "tsuru", "--controller-modes", "ingress-nginx"]
ports:
- containerPort: 8077
---
Expand Down
3 changes: 2 additions & 1 deletion deployments/rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rules:
resources:
- "services"
- "secrets"
- "events"
verbs:
- "*"
- apiGroups:
Expand All @@ -42,7 +43,7 @@ rules:
verbs:
- "get"
- apiGroups:
- "extensions/v1beta1"
- "networking.k8s.io"
resources:
- "ingresses"
verbs:
Expand Down

0 comments on commit 6aca766

Please sign in to comment.