Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: local development minor fixes #46

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading