Skip to content

Commit 188399e

Browse files
Merge pull request #41 from pluralsh/fix-ci.yaml
Fix stupid ci issue
2 parents 8443ed5 + 47b373a commit 188399e

File tree

237 files changed

+810
-785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+810
-785
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,22 @@ jobs:
6363
check-latest: true
6464
- uses: golangci/[email protected]
6565
with:
66-
version: v2.1.2
67-
# publish-debug-docker:
68-
# name: Build and push debug kas containers
69-
# runs-on: ubuntu-20.04
70-
# permissions:
71-
# contents: 'read'
72-
# id-token: 'write'
73-
# packages: 'write'
74-
# strategy:
75-
# matrix:
76-
# image: [kas-debug, agentk-debug]
77-
# include:
78-
# - image: kas-debug
79-
# dockerfile: ./build/docker/kas.debug.Dockerfile
80-
# - image: agentk-debug
81-
# dockerfile: ./build/docker/agentk.debug.Dockerfile
66+
version: v2.4.0
67+
publish-debug-docker:
68+
name: Build and push debug kas containers
69+
runs-on: ubuntu-latest
70+
permissions:
71+
contents: 'read'
72+
id-token: 'write'
73+
packages: 'write'
74+
strategy:
75+
matrix:
76+
image: [kas-debug, agentk-debug]
77+
include:
78+
- image: kas-debug
79+
dockerfile: ./build/docker/kas.debug.Dockerfile
80+
- image: agentk-debug
81+
dockerfile: ./build/docker/agentk.debug.Dockerfile
8282
steps:
8383
- name: Checkout
8484
uses: actions/checkout@v4

Makefile

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -124,32 +124,43 @@ codegen-delete: ## delete generated files
124124
.PHONY: --mocks
125125
--mocks:
126126
@PATH="${PATH}:$(shell pwd)/build" go generate -x -v \
127-
"github.com/pluralsh/kuberentes-agent/cmd/agentk/agentkapp" \
128-
"github.com/pluralsh/kuberentes-agent/cmd/kas/kasapp" \
129-
"github.com/pluralsh/kuberentes-agent/pkg/module/modagent" \
130-
"github.com/pluralsh/kuberentes-agent/pkg/module/reverse_tunnel/tunnel" \
131-
"github.com/pluralsh/kuberentes-agent/pkg/tool/redistool" \
132-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_agent_registrar" \
133-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_agent_tracker" \
134-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_cache" \
135-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_k8s" \
136-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_kubernetes_api" \
137-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_modagent" \
138-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_modserver" \
139-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_modshared" \
140-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_redis" \
141-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_reverse_tunnel_rpc" \
142-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_reverse_tunnel_tunnel" \
143-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_rpc" \
144-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_stdlib" \
145-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_tool" \
146-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_usage_metrics"
127+
"github.com/pluralsh/kubernetes-agent/cmd/agentk/agentkapp" \
128+
"github.com/pluralsh/kubernetes-agent/cmd/kas/kasapp" \
129+
"github.com/pluralsh/kubernetes-agent/pkg/module/modagent" \
130+
"github.com/pluralsh/kubernetes-agent/pkg/module/reverse_tunnel/tunnel" \
131+
"github.com/pluralsh/kubernetes-agent/pkg/tool/redistool" \
132+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_agent_registrar" \
133+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_agent_tracker" \
134+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_cache" \
135+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_k8s" \
136+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_kubernetes_api" \
137+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_modagent" \
138+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_modserver" \
139+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_modshared" \
140+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_redis" \
141+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_reverse_tunnel_rpc" \
142+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_reverse_tunnel_tunnel" \
143+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_rpc" \
144+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_stdlib" \
145+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_tool" \
146+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_usage_metrics"
147147

148148
##@ Tests
149149

150150
.PHONY: test
151-
test: ## run tests
152-
go test ./... -v
151+
test: tools ## run tests
152+
gotestsum --format pkgname -- ./... -v \
153+
-race -v -tags="cache"
154+
155+
.PHONY: tools
156+
tools: ## install required tools
157+
tools: --tool
158+
159+
.PHONY: --tool
160+
%--tool: TOOL = .*
161+
--tool: # INTERNAL: installs tool with name provided via $(TOOL) variable or all tools.
162+
@cat tools.go | grep _ | awk -F'"' '$$2 ~ /$(TOOL)/ {print $$2}' | xargs -I {} go install {}
163+
153164

154165
.PHONY: lint
155166
lint: --ensure-tools ## run linters

build/include/config.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ ifeq ($(GIT_TAG), )
2121
GIT_TAG = v0.0.0
2222
endif
2323

24-
LDFLAGS := -X "github.com/pluralsh/kuberentes-agent/cmd.Version=$(GIT_TAG)"
25-
LDFLAGS += -X "github.com/pluralsh/kuberentes-agent/cmd.Commit=$(GIT_COMMIT)"
26-
LDFLAGS += -X "github.com/pluralsh/kuberentes-agent/cmd.BuildTime=$(BUILD_TIME)"
24+
LDFLAGS := -X "github.com/pluralsh/kubernetes-agent/cmd.Version=$(GIT_TAG)"
25+
LDFLAGS += -X "github.com/pluralsh/kubernetes-agent/cmd.Commit=$(GIT_COMMIT)"
26+
LDFLAGS += -X "github.com/pluralsh/kubernetes-agent/cmd.BuildTime=$(BUILD_TIME)"
2727

2828
.PHONY: --certificate
2929
--certificate: --secrets --kubeconfig

cmd/agentk/agentkapp/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77

88
"go.uber.org/zap"
99

10-
"github.com/pluralsh/kuberentes-agent/pkg/tool/errz"
11-
"github.com/pluralsh/kuberentes-agent/pkg/tool/grpctool"
12-
"github.com/pluralsh/kuberentes-agent/pkg/tool/logz"
10+
"github.com/pluralsh/kubernetes-agent/pkg/tool/errz"
11+
"github.com/pluralsh/kubernetes-agent/pkg/tool/grpctool"
12+
"github.com/pluralsh/kubernetes-agent/pkg/tool/logz"
1313
)
1414

1515
// agentAPI is an implementation of modagent.API.

cmd/agentk/agentkapp/app.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ import (
1616
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus"
1717
"go.opentelemetry.io/otel/trace/noop"
1818

19-
"github.com/pluralsh/kuberentes-agent/cmd"
20-
"github.com/pluralsh/kuberentes-agent/pkg/agentcfg"
21-
"github.com/pluralsh/kuberentes-agent/pkg/api"
22-
"github.com/pluralsh/kuberentes-agent/pkg/entity"
23-
rpc2 "github.com/pluralsh/kuberentes-agent/pkg/module/agent_configuration/rpc"
24-
agent_registrar_agent "github.com/pluralsh/kuberentes-agent/pkg/module/agent_registrar/agent"
25-
kubernetes_api_agent "github.com/pluralsh/kuberentes-agent/pkg/module/kubernetes_api/agent"
26-
"github.com/pluralsh/kuberentes-agent/pkg/module/modagent"
27-
"github.com/pluralsh/kuberentes-agent/pkg/module/modshared"
28-
observability_agent "github.com/pluralsh/kuberentes-agent/pkg/module/observability/agent"
29-
reverse_tunnel_agent "github.com/pluralsh/kuberentes-agent/pkg/module/reverse_tunnel/agent"
30-
"github.com/pluralsh/kuberentes-agent/pkg/tool/errz"
31-
grpctool2 "github.com/pluralsh/kuberentes-agent/pkg/tool/grpctool"
32-
"github.com/pluralsh/kuberentes-agent/pkg/tool/httpz"
33-
logz2 "github.com/pluralsh/kuberentes-agent/pkg/tool/logz"
34-
"github.com/pluralsh/kuberentes-agent/pkg/tool/mathz"
35-
"github.com/pluralsh/kuberentes-agent/pkg/tool/metric"
36-
"github.com/pluralsh/kuberentes-agent/pkg/tool/retry"
37-
"github.com/pluralsh/kuberentes-agent/pkg/tool/tlstool"
38-
"github.com/pluralsh/kuberentes-agent/pkg/tool/wstunnel"
19+
"github.com/pluralsh/kubernetes-agent/cmd"
20+
"github.com/pluralsh/kubernetes-agent/pkg/agentcfg"
21+
"github.com/pluralsh/kubernetes-agent/pkg/api"
22+
"github.com/pluralsh/kubernetes-agent/pkg/entity"
23+
rpc2 "github.com/pluralsh/kubernetes-agent/pkg/module/agent_configuration/rpc"
24+
agent_registrar_agent "github.com/pluralsh/kubernetes-agent/pkg/module/agent_registrar/agent"
25+
kubernetes_api_agent "github.com/pluralsh/kubernetes-agent/pkg/module/kubernetes_api/agent"
26+
"github.com/pluralsh/kubernetes-agent/pkg/module/modagent"
27+
"github.com/pluralsh/kubernetes-agent/pkg/module/modshared"
28+
observability_agent "github.com/pluralsh/kubernetes-agent/pkg/module/observability/agent"
29+
reverse_tunnel_agent "github.com/pluralsh/kubernetes-agent/pkg/module/reverse_tunnel/agent"
30+
"github.com/pluralsh/kubernetes-agent/pkg/tool/errz"
31+
grpctool2 "github.com/pluralsh/kubernetes-agent/pkg/tool/grpctool"
32+
"github.com/pluralsh/kubernetes-agent/pkg/tool/httpz"
33+
logz2 "github.com/pluralsh/kubernetes-agent/pkg/tool/logz"
34+
"github.com/pluralsh/kubernetes-agent/pkg/tool/mathz"
35+
"github.com/pluralsh/kubernetes-agent/pkg/tool/metric"
36+
"github.com/pluralsh/kubernetes-agent/pkg/tool/retry"
37+
"github.com/pluralsh/kubernetes-agent/pkg/tool/tlstool"
38+
"github.com/pluralsh/kubernetes-agent/pkg/tool/wstunnel"
3939

4040
"github.com/coder/websocket"
4141
"github.com/prometheus/client_golang/prometheus"

cmd/agentk/agentkapp/app_internal_server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414
"google.golang.org/grpc"
1515
"google.golang.org/grpc/credentials/insecure"
1616

17-
modagent2 "github.com/pluralsh/kuberentes-agent/pkg/module/modagent"
18-
"github.com/pluralsh/kuberentes-agent/pkg/module/modshared"
19-
grpctool2 "github.com/pluralsh/kuberentes-agent/pkg/tool/grpctool"
20-
"github.com/pluralsh/kuberentes-agent/pkg/tool/logz"
17+
modagent2 "github.com/pluralsh/kubernetes-agent/pkg/module/modagent"
18+
"github.com/pluralsh/kubernetes-agent/pkg/module/modshared"
19+
grpctool2 "github.com/pluralsh/kubernetes-agent/pkg/tool/grpctool"
20+
"github.com/pluralsh/kubernetes-agent/pkg/tool/logz"
2121
)
2222

2323
type internalServer struct {

cmd/agentk/agentkapp/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package agentkapp
22

3-
//go:generate mockgen.sh -destination "mock_for_test.go" -package "agentkapp" "github.com/pluralsh/kuberentes-agent/cmd/agentk/agentkapp" "Runner,LeaderElector"
3+
//go:generate mockgen.sh -destination "mock_for_test.go" -package "agentkapp" "github.com/pluralsh/kubernetes-agent/cmd/agentk/agentkapp" "Runner,LeaderElector"

cmd/agentk/agentkapp/leader_election_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"testing"
66
"time"
77

8-
"github.com/pluralsh/kuberentes-agent/pkg/agentcfg"
9-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_modagent"
8+
"github.com/pluralsh/kubernetes-agent/pkg/agentcfg"
9+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_modagent"
1010

1111
"github.com/stretchr/testify/assert"
1212
"github.com/stretchr/testify/require"

cmd/agentk/agentkapp/leader_module_wrapper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package agentkapp
33
import (
44
"context"
55

6-
"github.com/pluralsh/kuberentes-agent/pkg/agentcfg"
7-
"github.com/pluralsh/kuberentes-agent/pkg/module/modagent"
6+
"github.com/pluralsh/kubernetes-agent/pkg/agentcfg"
7+
"github.com/pluralsh/kubernetes-agent/pkg/module/modagent"
88

99
"k8s.io/apimachinery/pkg/util/wait"
1010
)

cmd/agentk/agentkapp/leader_module_wrapper_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"testing"
77
"time"
88

9-
"github.com/pluralsh/kuberentes-agent/pkg/agentcfg"
10-
"github.com/pluralsh/kuberentes-agent/pkg/module/modagent"
11-
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_modagent"
9+
"github.com/pluralsh/kubernetes-agent/pkg/agentcfg"
10+
"github.com/pluralsh/kubernetes-agent/pkg/module/modagent"
11+
"github.com/pluralsh/kubernetes-agent/pkg/tool/testing/mock_modagent"
1212

1313
"github.com/stretchr/testify/assert"
1414
"github.com/stretchr/testify/require"

0 commit comments

Comments
 (0)