Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
16409eef
Unverified
Commit
16409eef
authored
Sep 29, 2025
by
Thomas Montfort
Committed by
GitHub
Sep 29, 2025
Browse files
fix: operator planner metric port injection (#3294)
parent
44a40a0b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
6 deletions
+42
-6
deploy/cloud/operator/internal/dynamo/component_planner.go
deploy/cloud/operator/internal/dynamo/component_planner.go
+1
-1
deploy/cloud/operator/internal/dynamo/component_planner_test.go
.../cloud/operator/internal/dynamo/component_planner_test.go
+1
-1
deploy/cloud/operator/internal/dynamo/graph.go
deploy/cloud/operator/internal/dynamo/graph.go
+1
-1
deploy/cloud/operator/internal/dynamo/graph_test.go
deploy/cloud/operator/internal/dynamo/graph_test.go
+39
-3
No files found.
deploy/cloud/operator/internal/dynamo/component_planner.go
View file @
16409eef
...
@@ -32,7 +32,7 @@ func (p *PlannerDefaults) GetBaseContainer(context ComponentContext) (corev1.Con
...
@@ -32,7 +32,7 @@ func (p *PlannerDefaults) GetBaseContainer(context ComponentContext) (corev1.Con
}
}
container
.
Env
=
append
(
container
.
Env
,
[]
corev1
.
EnvVar
{
container
.
Env
=
append
(
container
.
Env
,
[]
corev1
.
EnvVar
{
{
{
Name
:
"PROMETHEUS_PORT"
,
Name
:
"
PLANNER_
PROMETHEUS_PORT"
,
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
),
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
),
},
},
}
...
)
}
...
)
...
...
deploy/cloud/operator/internal/dynamo/component_planner_test.go
View file @
16409eef
...
@@ -55,7 +55,7 @@ func TestPlannerDefaults_GetBaseContainer(t *testing.T) {
...
@@ -55,7 +55,7 @@ func TestPlannerDefaults_GetBaseContainer(t *testing.T) {
{
Name
:
"DYN_NAMESPACE"
,
Value
:
"dynamo-namespace"
},
{
Name
:
"DYN_NAMESPACE"
,
Value
:
"dynamo-namespace"
},
{
Name
:
"DYN_PARENT_DGD_K8S_NAME"
,
Value
:
"name"
},
{
Name
:
"DYN_PARENT_DGD_K8S_NAME"
,
Value
:
"name"
},
{
Name
:
"DYN_PARENT_DGD_K8S_NAMESPACE"
,
Value
:
"namespace"
},
{
Name
:
"DYN_PARENT_DGD_K8S_NAMESPACE"
,
Value
:
"namespace"
},
{
Name
:
"PROMETHEUS_PORT"
,
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
)},
{
Name
:
"
PLANNER_
PROMETHEUS_PORT"
,
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
)},
},
},
},
},
},
},
...
...
deploy/cloud/operator/internal/dynamo/graph.go
View file @
16409eef
...
@@ -729,7 +729,7 @@ func GenerateBasePodSpec(
...
@@ -729,7 +729,7 @@ func GenerateBasePodSpec(
}
}
}
}
}
}
container
.
Env
=
MergeEnvs
(
co
mponent
.
Env
s
,
co
ntainer
.
Env
)
container
.
Env
=
MergeEnvs
(
co
ntainer
.
Env
,
co
mponent
.
Env
s
)
// Merge probes entirely if they are passed (no partial merge)
// Merge probes entirely if they are passed (no partial merge)
if
component
.
LivenessProbe
!=
nil
{
if
component
.
LivenessProbe
!=
nil
{
...
...
deploy/cloud/operator/internal/dynamo/graph_test.go
View file @
16409eef
...
@@ -625,6 +625,12 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
...
@@ -625,6 +625,12 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
},
},
},
},
},
},
Envs
:
[]
corev1
.
EnvVar
{
{
Name
:
"TEST_ENV"
,
Value
:
"test-value"
,
},
},
},
},
},
},
},
},
...
@@ -666,6 +672,12 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
...
@@ -666,6 +672,12 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Args
:
[]
string
{
"echo hello world"
,
"sleep 99999"
},
Args
:
[]
string
{
"echo hello world"
,
"sleep 99999"
},
},
},
},
},
Envs
:
[]
corev1
.
EnvVar
{
{
Name
:
"TEST_ENV"
,
Value
:
"test-value"
,
},
},
},
},
},
},
},
},
...
@@ -699,6 +711,12 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
...
@@ -699,6 +711,12 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
},
},
},
},
Autoscaling
:
nil
,
Autoscaling
:
nil
,
Envs
:
[]
corev1
.
EnvVar
{
{
Name
:
"TEST_ENV"
,
Value
:
"test-value"
,
},
},
},
},
},
},
},
},
...
@@ -1501,7 +1519,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
...
@@ -1501,7 +1519,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
Value
:
"http://localhost:9090"
,
Value
:
"http://localhost:9090"
,
},
},
{
{
Name
:
"PROMETHEUS_PORT"
,
Name
:
"
PLANNER_
PROMETHEUS_PORT"
,
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
),
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
),
},
},
},
},
...
@@ -2276,7 +2294,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
...
@@ -2276,7 +2294,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
Value
:
"test-namespace"
,
Value
:
"test-namespace"
,
},
},
{
{
Name
:
"PROMETHEUS_PORT"
,
Name
:
"
PLANNER_
PROMETHEUS_PORT"
,
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
),
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
),
},
},
},
},
...
@@ -3067,7 +3085,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
...
@@ -3067,7 +3085,7 @@ func TestGenerateGrovePodCliqueSet(t *testing.T) {
Value
:
"test-namespace"
,
Value
:
"test-namespace"
,
},
},
{
{
Name
:
"PROMETHEUS_PORT"
,
Name
:
"
PLANNER_
PROMETHEUS_PORT"
,
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
),
Value
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoPlannerMetricsPort
),
},
},
},
},
...
@@ -4347,6 +4365,24 @@ func TestGenerateBasePodSpec_Frontend(t *testing.T) {
...
@@ -4347,6 +4365,24 @@ func TestGenerateBasePodSpec_Frontend(t *testing.T) {
"DYN_HTTP_PORT"
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoServicePort
),
"DYN_HTTP_PORT"
:
fmt
.
Sprintf
(
"%d"
,
commonconsts
.
DynamoServicePort
),
},
},
},
},
{
name
:
"frontend with overriding env var"
,
component
:
&
v1alpha1
.
DynamoComponentDeploymentOverridesSpec
{
DynamoComponentDeploymentSharedSpec
:
v1alpha1
.
DynamoComponentDeploymentSharedSpec
{
ComponentType
:
commonconsts
.
ComponentTypeFrontend
,
Envs
:
[]
corev1
.
EnvVar
{
{
Name
:
"DYN_HTTP_PORT"
,
Value
:
"3000"
,
},
},
},
},
backendFramework
:
BackendFrameworkVLLM
,
wantEnvVars
:
map
[
string
]
string
{
"DYN_HTTP_PORT"
:
"3000"
,
},
},
}
}
for
_
,
tt
:=
range
tests
{
for
_
,
tt
:=
range
tests
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment