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
390a3397
Unverified
Commit
390a3397
authored
Aug 24, 2025
by
julienmancuso
Committed by
GitHub
Aug 24, 2025
Browse files
fix: do not fail if backendFramework cannot be detected (#2655)
parent
266265ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
deploy/cloud/operator/internal/dynamo/graph.go
deploy/cloud/operator/internal/dynamo/graph.go
+4
-4
deploy/cloud/operator/internal/dynamo/graph_test.go
deploy/cloud/operator/internal/dynamo/graph_test.go
+18
-18
No files found.
deploy/cloud/operator/internal/dynamo/graph.go
View file @
390a3397
...
@@ -1012,7 +1012,7 @@ func detectBackendFrameworkFromArgs(command []string, args []string) (BackendFra
...
@@ -1012,7 +1012,7 @@ func detectBackendFrameworkFromArgs(command []string, args []string) (BackendFra
}
}
if
len
(
detected
)
==
0
{
if
len
(
detected
)
==
0
{
return
""
,
fmt
.
Errorf
(
"no b
ackend
f
ramework
detected from command: %q"
,
fullCommand
)
return
B
ackend
F
ramework
Noop
,
nil
}
}
if
len
(
detected
)
>
1
{
if
len
(
detected
)
>
1
{
...
@@ -1059,13 +1059,13 @@ func determineBackendFramework(
...
@@ -1059,13 +1059,13 @@ func determineBackendFramework(
}
}
// Validate consistency if both detected and explicit exist
// Validate consistency if both detected and explicit exist
if
detectedFramework
!=
""
&&
explicitFramework
!=
""
&&
detectedFramework
!=
explicitFramework
{
if
detectedFramework
!=
""
&&
detectedFramework
!=
BackendFrameworkNoop
&&
explicitFramework
!=
""
&&
detectedFramework
!=
explicitFramework
{
return
""
,
fmt
.
Errorf
(
"backend framework mismatch: detected %q from command but explicitly configured as %q"
,
return
""
,
fmt
.
Errorf
(
"backend framework mismatch: detected %q from command but explicitly configured as %q"
,
detectedFramework
,
explicitFramework
)
detectedFramework
,
explicitFramework
)
}
}
// Return in order of preference: detected > explicit > error
// Return in order of preference: detected > explicit > error
if
detectedFramework
!=
""
{
if
detectedFramework
!=
""
&&
detectedFramework
!=
BackendFrameworkNoop
{
return
detectedFramework
,
nil
return
detectedFramework
,
nil
}
}
...
@@ -1079,7 +1079,7 @@ func determineBackendFramework(
...
@@ -1079,7 +1079,7 @@ func determineBackendFramework(
}
}
// No command/args to detect from and no explicit config
// No command/args to detect from and no explicit config
return
""
,
fmt
.
Errorf
(
"b
ackend
f
ramework
must be specified explicitly or detectable from command/args"
)
return
B
ackend
F
ramework
Noop
,
nil
}
}
// getBackendFrameworkFromComponent attempts to determine backend framework using hybrid approach:
// getBackendFrameworkFromComponent attempts to determine backend framework using hybrid approach:
...
...
deploy/cloud/operator/internal/dynamo/graph_test.go
View file @
390a3397
...
@@ -3626,10 +3626,10 @@ func TestDetectBackendFrameworkFromArgs(t *testing.T) {
...
@@ -3626,10 +3626,10 @@ func TestDetectBackendFrameworkFromArgs(t *testing.T) {
expected
:
BackendFrameworkSGLang
,
expected
:
BackendFrameworkSGLang
,
},
},
{
{
name
:
"no backend detected"
,
name
:
"no backend detected"
,
command
:
[]
string
{
"/bin/sh"
,
"-c"
},
command
:
[]
string
{
"/bin/sh"
,
"-c"
},
args
:
[]
string
{
"echo hello world"
},
args
:
[]
string
{
"echo hello world"
},
expect
Error
:
true
,
expect
ed
:
BackendFrameworkNoop
,
},
},
{
{
name
:
"multiple backends detected"
,
name
:
"multiple backends detected"
,
...
@@ -3709,17 +3709,17 @@ func TestDetermineBackendFramework(t *testing.T) {
...
@@ -3709,17 +3709,17 @@ func TestDetermineBackendFramework(t *testing.T) {
errorContains
:
"backend framework mismatch"
,
errorContains
:
"backend framework mismatch"
,
},
},
{
{
name
:
"worker with no detection, no explicit - returns
error
"
,
name
:
"worker with no detection, no explicit - returns
noop
"
,
componentType
:
"worker"
,
componentType
:
"worker"
,
expect
Error
:
true
,
expect
ed
:
BackendFrameworkNoop
,
e
rrorContains
:
"backend framework must be specified explicitly or detectable from command/args"
,
e
xpectError
:
false
,
},
},
{
{
name
:
"worker with detection failure, no explicit - returns
error
"
,
name
:
"worker with detection failure, no explicit - returns
noop
"
,
componentType
:
"worker"
,
componentType
:
"worker"
,
args
:
[]
string
{
"echo hello world"
},
args
:
[]
string
{
"echo hello world"
},
expect
Error
:
true
,
expect
ed
:
BackendFrameworkNoop
,
e
rrorContains
:
"could not determine backend framework"
,
e
xpectError
:
false
,
},
},
}
}
...
@@ -3843,18 +3843,18 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) {
...
@@ -3843,18 +3843,18 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) {
expected
:
BackendFrameworkNoop
,
expected
:
BackendFrameworkNoop
,
},
},
{
{
name
:
"worker with no detection, no explicit - returns
error
"
,
name
:
"worker with no detection, no explicit - returns
noop
"
,
component
:
&
v1alpha1
.
DynamoComponentDeploymentOverridesSpec
{
component
:
&
v1alpha1
.
DynamoComponentDeploymentOverridesSpec
{
DynamoComponentDeploymentSharedSpec
:
v1alpha1
.
DynamoComponentDeploymentSharedSpec
{
DynamoComponentDeploymentSharedSpec
:
v1alpha1
.
DynamoComponentDeploymentSharedSpec
{
ComponentType
:
"worker"
,
// Worker component
ComponentType
:
"worker"
,
// Worker component
},
},
},
},
deployment
:
&
v1alpha1
.
DynamoGraphDeployment
{},
deployment
:
&
v1alpha1
.
DynamoGraphDeployment
{},
expect
Error
:
true
,
expect
ed
:
BackendFrameworkNoop
,
e
rrorContains
:
"backend framework must be specified explicitly or detectable from command/args"
,
e
xpectError
:
false
,
},
},
{
{
name
:
"worker with detection failure, no explicit - returns
error
"
,
name
:
"worker with detection failure, no explicit - returns
noop
"
,
component
:
&
v1alpha1
.
DynamoComponentDeploymentOverridesSpec
{
component
:
&
v1alpha1
.
DynamoComponentDeploymentOverridesSpec
{
DynamoComponentDeploymentSharedSpec
:
v1alpha1
.
DynamoComponentDeploymentSharedSpec
{
DynamoComponentDeploymentSharedSpec
:
v1alpha1
.
DynamoComponentDeploymentSharedSpec
{
ComponentType
:
"worker"
,
// Worker component
ComponentType
:
"worker"
,
// Worker component
...
@@ -3865,9 +3865,9 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) {
...
@@ -3865,9 +3865,9 @@ func TestGetBackendFrameworkFromComponent(t *testing.T) {
},
},
},
},
},
},
deployment
:
&
v1alpha1
.
DynamoGraphDeployment
{},
deployment
:
&
v1alpha1
.
DynamoGraphDeployment
{},
expect
Error
:
true
,
expect
ed
:
BackendFrameworkNoop
,
e
rrorContains
:
"could not determine backend framework"
,
e
xpectError
:
false
,
},
},
}
}
...
...
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