@@ -50,17 +50,20 @@ db_user:=maestro
5050db_password: =foobar-bizz-buzz
5151db_password_file =${PWD}/secrets/db.password
5252db_sslmode: =disable
53- db_image? =docker .io/library /postgres:14 .2
53+ db_image? =quay .io/maestro /postgres:17 .2
5454
5555# Message broker connection details
56- mqtt_host =maestro-mqtt.$(namespace )
57- mqtt_port =1883
58- mqtt_user: =maestro
59- mqtt_password_file =${PWD}/secrets/mqtt.password
60- mqtt_config_file =${PWD}/secrets/mqtt.config
56+ mqtt_host ?= maestro-mqtt.$(namespace )
57+ mqtt_port ?= 1883
58+ mqtt_user ?= maestro
59+ mqtt_password_file ?= ${PWD}/secrets/mqtt.password
60+ mqtt_config_file ?= ${PWD}/secrets/mqtt.config
61+ mqtt_root_cert ?= ""
62+ mqtt_client_cert ?= ""
63+ mqtt_client_key ?= ""
6164
6265# Log verbosity level
63- klog_v: =10
66+ klog_v: =4
6467
6568# Location of the JSON web key set used to verify tokens:
6669jwks_url: =https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/certs
@@ -76,7 +79,7 @@ CLIENT_SECRET ?= maestro
7679ENABLE_JWT ?= true
7780ENABLE_AUTHZ ?= true
7881ENABLE_OCM_MOCK ?= false
79- ENABLE_GRPC_SERVER ?= false
82+ ENABLE_GRPC_SERVER ?= true
8083
8184# message driver type, mqtt or grpc, default is mqtt.
8285MESSAGE_DRIVER_TYPE ?= mqtt
@@ -85,12 +88,27 @@ MESSAGE_DRIVER_TYPE ?= mqtt
8588SERVER_REPLICAS ?= 1
8689
8790# Enable set images
88- POSTGRES_IMAGE ?= docker .io/library /postgres:14 .2
89- MQTT_IMAGE ?= docker .io/library /eclipse-mosquitto:2.0.18
91+ POSTGRES_IMAGE ?= quay .io/maestro /postgres:17 .2
92+ MQTT_IMAGE ?= quay .io/maestro /eclipse-mosquitto:2.0.18
9093
9194# Test output files
9295unit_test_json_output ?= ${PWD}/unit-test-results.json
93- integration_test_json_output ?= ${PWD}/integration-test-results.json
96+ mqtt_integration_test_json_output ?= ${PWD}/mqtt-integration-test-results.json
97+ grpc_integration_test_json_output ?= ${PWD}/grpc-integration-test-results.json
98+
99+ # maestro services config
100+ maestro_svc_type ?= ClusterIP
101+ maestro_svc_node_port ?= 0
102+ grpc_svc_type ?= ClusterIP
103+ grpc_svc_node_port ?= 0
104+
105+ # maestro deployment config
106+ liveness_probe_init_delay_seconds ?= 15
107+ readiness_probe_init_delay_seconds ?= 20
108+
109+ # subscription config
110+ subscription_type ?= shared
111+ agent_topic ?= "\$$share/statussubscribers/sources/maestro/consumers/+/agentevents"
94112
95113# Prints a list of useful targets.
96114help :
@@ -117,7 +135,7 @@ help:
117135
118136# Encourage consistent tool versions
119137OPENAPI_GENERATOR_VERSION: =5.4.0
120- GO_VERSION: =go1.22 .
138+ GO_VERSION: =go1.23 .
121139
122140# ## Constants:
123141version: =$(shell date +% s)
@@ -126,11 +144,11 @@ GOLANGCI_LINT_BIN:=$(shell go env GOPATH)/bin/golangci-lint
126144# ## Envrionment-sourced variables with defaults
127145# Can be overriden by setting environment var before running
128146# Example:
129- # OCM_ENV =testing make run
130- # export OCM_ENV =testing; make run
147+ # MAESTRO_ENV =testing make run
148+ # export MAESTRO_ENV =testing; make run
131149# Set the environment to development by default
132- ifndef OCM_ENV
133- OCM_ENV :=development
150+ ifndef MAESTRO_ENV
151+ MAESTRO_ENV :=development
134152endif
135153
136154ifndef TEST_SUMMARY_FORMAT
@@ -203,7 +221,7 @@ install: check-gopath
203221# Examples:
204222# make test TESTFLAGS="-run TestSomething"
205223test :
206- OCM_ENV =testing gotestsum --jsonfile-timing-events=$(unit_test_json_output ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -v $(TESTFLAGS ) \
224+ MAESTRO_ENV =testing gotestsum --jsonfile-timing-events=$(unit_test_json_output ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -v $(TESTFLAGS ) \
207225 ./pkg/... \
208226 ./cmd/...
209227.PHONY : test
@@ -218,11 +236,19 @@ test:
218236# make test-integration TESTFLAGS="-run TestAccounts" acts as TestAccounts* and run TestAccountsGet, TestAccountsPost, etc.
219237# make test-integration TESTFLAGS="-run TestAccountsGet" runs TestAccountsGet
220238# make test-integration TESTFLAGS="-short" skips long-run tests
221- test-integration :
222- OCM_ENV=testing gotestsum --jsonfile-timing-events=$(integration_test_json_output ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -ldflags -s -v -timeout 1h $(TESTFLAGS ) \
223- ./test/integration
239+ test-integration : test-integration-mqtt test-integration-grpc
224240.PHONY : test-integration
225241
242+ test-integration-mqtt :
243+ BROKER=mqtt MAESTRO_ENV=testing gotestsum --jsonfile-timing-events=$(mqtt_integration_test_json_output ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -ldflags -s -v -timeout 1h $(TESTFLAGS ) \
244+ ./test/integration
245+ .PHONY : test-integration-mqtt
246+
247+ test-integration-grpc :
248+ BROKER=grpc MAESTRO_ENV=testing gotestsum --jsonfile-timing-events=$(grpc_integration_test_json_output ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -ldflags -s -v -timeout 1h $(TESTFLAGS ) \
249+ ./test/integration
250+ .PHONY : test-integration-grpc
251+
226252# Regenerate openapi client and models
227253generate :
228254 rm -rf pkg/api/openapi
@@ -269,7 +295,7 @@ cmds:
269295 --filename=" templates/$* -template.yml" \
270296 --local=" true" \
271297 --ignore-unknown-parameters=" true" \
272- --param=" ENVIRONMENT=$( OCM_ENV ) " \
298+ --param=" ENVIRONMENT=$( MAESTRO_ENV ) " \
273299 --param=" KLOG_V=$( klog_v) " \
274300 --param=" SERVER_REPLICAS=$( SERVER_REPLICAS) " \
275301 --param=" DATABASE_HOST=$( db_host) " \
@@ -283,9 +309,9 @@ cmds:
283309 --param=" MQTT_PORT=$( mqtt_port) " \
284310 --param=" MQTT_USER=$( mqtt_user) " \
285311 --param=" MQTT_PASSWORD=$( shell cat $( mqtt_password_file) ) " \
286- --param=" MQTT_ROOT_CERT=" \
287- --param=" MQTT_CLIENT_CERT=" \
288- --param=" MQTT_CLIENT_KEY=" \
312+ --param=" MQTT_ROOT_CERT=$( mqtt_root_cert ) " \
313+ --param=" MQTT_CLIENT_CERT=$( mqtt_client_cert ) " \
314+ --param=" MQTT_CLIENT_KEY=$( mqtt_client_key ) " \
289315 --param=" MQTT_IMAGE=$( MQTT_IMAGE) " \
290316 --param=" IMAGE_REGISTRY=$( internal_image_registry) " \
291317 --param=" IMAGE_REPOSITORY=$( image_repository) " \
@@ -309,6 +335,14 @@ cmds:
309335 --param=" ENABLE_OCM_MOCK=$( ENABLE_OCM_MOCK) " \
310336 --param=" ENABLE_GRPC_SERVER=$( ENABLE_GRPC_SERVER) " \
311337 --param=" MESSAGE_DRIVER_TYPE" =$(MESSAGE_DRIVER_TYPE ) \
338+ --param=" MAESTRO_SVC_TYPE" =$(maestro_svc_type ) \
339+ --param=" MAESTRO_SVC_NODE_PORT" =$(maestro_svc_node_port ) \
340+ --param=" GRPC_SVC_TYPE" =$(grpc_svc_type ) \
341+ --param=" GRPC_SVC_NODE_PORT" =$(grpc_svc_node_port ) \
342+ --param=" LIVENESS_PROBE_INIT_DELAY_SECONDS" =$(liveness_probe_init_delay_seconds ) \
343+ --param=" READINESS_PROBE_INIT_DELAY_SECONDS" =$(readiness_probe_init_delay_seconds ) \
344+ --param=" SUBSCRIPTION_TYPE" =$(subscription_type ) \
345+ --param=" AGENT_TOPIC" =$(agent_topic ) \
312346 > " templates/$* -template.json"
313347
314348
@@ -417,7 +451,7 @@ e2e-test/teardown:
417451 ./test/e2e/setup/e2e_teardown.sh
418452.PHONY : e2e-test/teardown
419453
420- e2e-test : e2e-test/teardown e2e-test/setup
454+ e2e-test/run :
421455 ginkgo -v --fail-fast --label-filter=" !(e2e-tests-spec-resync-reconnect||e2e-tests-status-resync-reconnect)" \
422456 --output-dir=" ${PWD} /test/e2e/report" --json-report=report.json --junit-report=report.xml \
423457 ${PWD} /test/e2e/pkg -- \
@@ -426,4 +460,11 @@ e2e-test: e2e-test/teardown e2e-test/setup
426460 -server-kubeconfig=${PWD} /test/e2e/.kubeconfig \
427461 -consumer-name=$(shell cat ${PWD}/test/e2e/.consumer_name) \
428462 -agent-kubeconfig=${PWD} /test/e2e/.kubeconfig
463+ .PHONY : e2e-test/run
464+
465+ e2e-test : e2e-test/teardown e2e-test/setup e2e-test/run
429466.PHONY : e2e-test
467+
468+ migration-test : e2e-test/teardown
469+ ./test/e2e/migration/test.sh
470+ .PHONY : migration-test
0 commit comments