Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Oct 23, 2023
2 parents 88dba98 + 48ff313 commit 701deaf
Show file tree
Hide file tree
Showing 118 changed files with 2,109 additions and 2,136 deletions.
48 changes: 24 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ docker-agentk-debug: --image-debug ## build docker agentk debug image with embed
##@ Codegen

.PHONY: codegen
codegen: --ensure-tools codegen-delete --mocks --protoc ## regenerate protobuf and mocks
codegen: --ensure-tools codegen-delete --protoc --mocks ## regenerate protobuf and mocks

.PHONY: codegen-delete
codegen-delete: ## delete generated files
find . -name '*.pb.go' -type f -delete
find . -name '*.pb.validate.go' -type f -delete
find . \( -name '*_pb.rb' -and -not -name 'validate_pb.rb' \) -type f -delete
find . -name '*_proto_docs.md' -type f -delete
find . -empty -type d -delete
@find . -name '*.pb.go' -type f -delete
@find . -name '*.pb.validate.go' -type f -delete
@find . \( -name '*_pb.rb' -and -not -name 'validate_pb.rb' \) -type f -delete
@find . -name '*_proto_docs.md' -type f -delete
@find . -empty -type d -delete

.PHONY: --protoc
--protoc:
Expand All @@ -124,24 +124,24 @@ codegen-delete: ## delete generated files
@PATH="${PATH}:$(shell pwd)/build" go generate -x -v \
"github.com/pluralsh/kuberentes-agent/cmd/agentk/agentkapp" \
"github.com/pluralsh/kuberentes-agent/cmd/kas/kasapp" \
"github.com/pluralsh/kuberentes-agent/internal/module/modagent" \
"github.com/pluralsh/kuberentes-agent/internal/module/reverse_tunnel/tunnel" \
"github.com/pluralsh/kuberentes-agent/internal/tool/redistool" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_agent_registrar" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_agent_tracker" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_cache" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_k8s" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_kubernetes_api" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_modagent" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_modserver" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_modshared" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_redis" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_reverse_tunnel_rpc" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_reverse_tunnel_tunnel" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_rpc" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_stdlib" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_tool" \
"github.com/pluralsh/kuberentes-agent/internal/tool/testing/mock_usage_metrics"
"github.com/pluralsh/kuberentes-agent/pkg/module/modagent" \
"github.com/pluralsh/kuberentes-agent/pkg/module/reverse_tunnel/tunnel" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/redistool" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_agent_registrar" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_agent_tracker" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_cache" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_k8s" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_kubernetes_api" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_modagent" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_modserver" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_modshared" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_redis" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_reverse_tunnel_rpc" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_reverse_tunnel_tunnel" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_rpc" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_stdlib" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_tool" \
"github.com/pluralsh/kuberentes-agent/pkg/tool/testing/mock_usage_metrics"

##@ Tests

Expand Down
2 changes: 1 addition & 1 deletion build/include/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.PHONY: --ensure-go-tools
--ensure-go-tools:
@echo "ensuring required tools availability..."
@cat internal/tool/tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
@cat pkg/tool/tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
3 changes: 1 addition & 2 deletions build/protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ function plrl::protoc::generate() {

plrl::protoc::ensure
plrl::protoc::generate "${ROOT_DIR}/cmd"
plrl::protoc::generate "${ROOT_DIR}/pkg"
plrl::protoc::generate "${ROOT_DIR}/internal"
plrl::protoc::generate "${ROOT_DIR}/pkg"
4 changes: 2 additions & 2 deletions cmd/agentk/agentkapp/app_internal_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ func newInternalServer(log *zap.Logger, tp trace.TracerProvider, mp otelmetric.M
grpc.StatsHandler(grpctool2.ServerNoopMaxConnAgeStatsHandler{}),
grpc.SharedWriteBuffer(true),
grpc.ChainStreamInterceptor(
streamProm, // 1. measure all invocations
streamProm, // 1. measure all invocations
modagent2.StreamRpcApiInterceptor(factory), // 2. inject RPC API
grpc_validator.StreamServerInterceptor(), // x. wrap with validator
),
grpc.ChainUnaryInterceptor(
unaryProm, // 1. measure all invocations
unaryProm, // 1. measure all invocations
modagent2.UnaryRpcApiInterceptor(factory), // 2. inject RPC API
grpc_validator.UnaryServerInterceptor(), // x. wrap with validator
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package main

import (
Expand All @@ -10,30 +11,29 @@ import (

"go.uber.org/mock/mockgen/model"

pkg_ "github.com/pluralsh/kuberentes-agent/pkg/module/modagent"
pkg_ "github.com/pluralsh/kuberentes-agent/cmd/agentk/agentkapp"
)

var output = flag.String("output", "", "The output file name, or empty to use stdout.")

func main() {
flag.Parse()

its := []struct {
its := []struct{
sym string
typ reflect.Type
}{

{"Api", reflect.TypeOf((*pkg_.Api)(nil)).Elem()},

{"Factory", reflect.TypeOf((*pkg_.Factory)(nil)).Elem()},

{"Module", reflect.TypeOf((*pkg_.Module)(nil)).Elem()},

{ "Runner", reflect.TypeOf((*pkg_.Runner)(nil)).Elem()},

{ "LeaderElector", reflect.TypeOf((*pkg_.LeaderElector)(nil)).Elem()},

}
pkg := &model.Package{
// NOTE: This behaves contrary to documented behaviour if the
// package name is not the final component of the import path.
// The reflect package doesn't expose the package name, though.
Name: path.Base("github.com/pluralsh/kuberentes-agent/internal/module/modagent"),
Name: path.Base("github.com/pluralsh/kuberentes-agent/cmd/agentk/agentkapp"),
}

for _, it := range its {
Expand Down
1 change: 0 additions & 1 deletion cmd/kas/kasapp/configured_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ func (a *ConfiguredApp) constructPluralRpcApiFactory(errRep errz.ErrReporter, se
dt,
gapi.IsCacheableError,
),
PluralClient: pluralclient.New(a.Configuration.PluralUrl, a.Configuration.PluralToken),
}
return f.New, fAgent.New
}
Expand Down
Loading

0 comments on commit 701deaf

Please sign in to comment.