From 6aca766919dcea90ed2bf41efcd12fdf7f4f5aec Mon Sep 17 00:00:00 2001 From: gvicentin Date: Wed, 28 Aug 2024 10:37:47 -0300 Subject: [PATCH] fix: local development minor fixes --- Dockerfile | 2 +- Makefile | 14 ++++++++------ deployments/local.yml | 2 +- deployments/rbac.yml | 3 ++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index e2c3072d..918cea14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index e818b52e..bd8716f7 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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: @@ -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 diff --git a/deployments/local.yml b/deployments/local.yml index 41488cd3..db3c6b45 100644 --- a/deployments/local.yml +++ b/deployments/local.yml @@ -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 --- diff --git a/deployments/rbac.yml b/deployments/rbac.yml index 7d54e127..d011bbaa 100644 --- a/deployments/rbac.yml +++ b/deployments/rbac.yml @@ -21,6 +21,7 @@ rules: resources: - "services" - "secrets" + - "events" verbs: - "*" - apiGroups: @@ -42,7 +43,7 @@ rules: verbs: - "get" - apiGroups: - - "extensions/v1beta1" + - "networking.k8s.io" resources: - "ingresses" verbs: