From 30c1a9e5a81b93f321a3e223a58f420b2dcc56c3 Mon Sep 17 00:00:00 2001 From: morvencao Date: Mon, 24 Feb 2025 02:54:12 +0000 Subject: [PATCH] address comments. Signed-off-by: morvencao --- Makefile | 2 +- README.md | 8 ++++---- cmd/maestro/environments/e_integration_testing.go | 1 - docs/grpc.md | 4 +--- examples/grpc/README.md | 8 +------- examples/manifestworkclient/client/README.md | 8 +------- pkg/config/grpc_server.go | 2 +- test/e2e/setup/e2e_setup.sh | 1 - 8 files changed, 9 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 2b718d0d..080533e1 100755 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ CLIENT_SECRET ?= maestro ENABLE_JWT ?= true ENABLE_AUTHZ ?= true ENABLE_OCM_MOCK ?= false -ENABLE_GRPC_SERVER ?= false +ENABLE_GRPC_SERVER ?= true # message driver type, mqtt or grpc, default is mqtt. MESSAGE_DRIVER_TYPE ?= mqtt diff --git a/README.md b/README.md index c1c26d93..a57e2707 100755 --- a/README.md +++ b/README.md @@ -144,15 +144,15 @@ ocm login --token=${OCM_ACCESS_TOKEN} --url=http://localhost:8000 ``` -#### List the resource bundle +#### List the consumers -This will be empty if no resource bundle is ever created +This will be empty if no consumer is ever created ```shell -$ ocm get /api/maestro/v1/resource-bundles +$ ocm get /api/maestro/v1/consumers { "items": [], - "kind": "ResourceBundleList", + "kind": "ConsumerList", "page": 1, "size": 0, "total": 0 diff --git a/cmd/maestro/environments/e_integration_testing.go b/cmd/maestro/environments/e_integration_testing.go index 71cfd0ea..37b34586 100755 --- a/cmd/maestro/environments/e_integration_testing.go +++ b/cmd/maestro/environments/e_integration_testing.go @@ -54,6 +54,5 @@ func (e *testingEnvImpl) Flags() map[string]string { "enable-ocm-mock": "true", "enable-sentry": "false", "source-id": "maestro", - "enable-grpc-server": "true", } } diff --git a/docs/grpc.md b/docs/grpc.md index 1146cede..60818e19 100644 --- a/docs/grpc.md +++ b/docs/grpc.md @@ -1,6 +1,4 @@ -# gRPC server - -gPRC server is disabled by default. You can enable it by passing `--enable-grpc-server=true` to the maestro server command. +# Maestro gRPC server ## Authentication and Authorization diff --git a/examples/grpc/README.md b/examples/grpc/README.md index dc95bcd3..bbfa99d5 100644 --- a/examples/grpc/README.md +++ b/examples/grpc/README.md @@ -2,13 +2,7 @@ ## Preparation -1. Enable gRPC server by passing `--enable-grpc-server=true` to the maestro server start command: - -```shell -$ kubectl -n maestro patch deploy/maestro --type=json -p='[{"op":"add","path":"/spec/template/spec/containers/0/command/-","value":"--enable-grpc-server=true"}]' -``` - -2. Do the port-forward the maestro-grpc service: +Do the port-forward the maestro-grpc service: ```shell $ kubectl -n maestro port-forward svc/maestro-grpc 8090 & diff --git a/examples/manifestworkclient/client/README.md b/examples/manifestworkclient/client/README.md index bad9ce4c..d73fd726 100644 --- a/examples/manifestworkclient/client/README.md +++ b/examples/manifestworkclient/client/README.md @@ -2,13 +2,7 @@ ## Preparation -1. Enable gRPC server by passing `--enable-grpc-server=true` to the maestro server start command: - -```shell -$ kubectl -n maestro patch deploy/maestro --type=json -p='[{"op":"add","path":"/spec/template/spec/containers/0/command/-","value":"--enable-grpc-server=true"}]' -``` - -2. Do the port-forward for the maestro and maestro-grpc services: +Do the port-forward for the maestro and maestro-grpc services: ```shell $ kubectl -n maestro port-forward svc/maestro 8000 & diff --git a/pkg/config/grpc_server.go b/pkg/config/grpc_server.go index 6d5929aa..5f2ccf96 100755 --- a/pkg/config/grpc_server.go +++ b/pkg/config/grpc_server.go @@ -38,7 +38,7 @@ func NewGRPCServerConfig() *GRPCServerConfig { } func (s *GRPCServerConfig) AddFlags(fs *pflag.FlagSet) { - fs.BoolVar(&s.EnableGRPCServer, "enable-grpc-server", false, "Enable gRPC server") + fs.BoolVar(&s.EnableGRPCServer, "enable-grpc-server", true, "Enable gRPC server") fs.StringVar(&s.ServerBindPort, "grpc-server-bindport", "8090", "gPRC server bind port") fs.StringVar(&s.BrokerBindPort, "grpc-broker-bindport", "8091", "gPRC broker bind port") fs.Uint32Var(&s.MaxConcurrentStreams, "grpc-max-concurrent-streams", math.MaxUint32, "gPRC max concurrent streams") diff --git a/test/e2e/setup/e2e_setup.sh b/test/e2e/setup/e2e_setup.sh index 78727518..840e396e 100755 --- a/test/e2e/setup/e2e_setup.sh +++ b/test/e2e/setup/e2e_setup.sh @@ -117,7 +117,6 @@ fi # 7. deploy maestro into maestro namespace export ENABLE_JWT=false export ENABLE_OCM_MOCK=true -export ENABLE_GRPC_SERVER=true export maestro_svc_type="NodePort" export maestro_svc_node_port=30080 export grpc_svc_type="NodePort"