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
a98b4d1f
Unverified
Commit
a98b4d1f
authored
Apr 03, 2026
by
hhzhang16
Committed by
GitHub
Apr 03, 2026
Browse files
feat: add owner references to DGDR-created ConfigMaps (#7782)
Signed-off-by:
Hannah Zhang
<
hannahz@nvidia.com
>
parent
43e810a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
9 deletions
+22
-9
deploy/operator/internal/controller/dynamographdeploymentrequest_controller.go
...nal/controller/dynamographdeploymentrequest_controller.go
+22
-9
No files found.
deploy/operator/internal/controller/dynamographdeploymentrequest_controller.go
View file @
a98b4d1f
...
...
@@ -169,6 +169,13 @@ metadata:
dgdr.nvidia.com/name: {{.DGDRName}}
dgdr.nvidia.com/namespace: {{.Namespace}}
nvidia.com/managed-by: dynamo-operator
ownerReferences:
- apiVersion: nvidia.com/v1beta1
kind: DynamoGraphDeploymentRequest
name: {{.DGDRName}}
uid: {{.DGDRuid}}
blockOwnerDeletion: true
controller: true
data:
phase: "$PHASE"
message: "$MESSAGE"
...
...
@@ -265,6 +272,13 @@ metadata:
dgdr.nvidia.com/name: {{.DGDRName}}
dgdr.nvidia.com/namespace: {{.Namespace}}
nvidia.com/managed-by: dynamo-operator
ownerReferences:
- apiVersion: nvidia.com/v1beta1
kind: DynamoGraphDeploymentRequest
name: {{.DGDRName}}
uid: {{.DGDRuid}}
blockOwnerDeletion: true
controller: true
data:
phase: "$FINAL_PHASE"
message: "$FINAL_MESSAGE"
...
...
@@ -946,16 +960,14 @@ func (r *DynamoGraphDeploymentRequestReconciler) createAdditionalResources(ctx c
cm
.
Labels
[
nvidiacomv1beta1
.
LabelDGDRNamespace
]
=
dgdr
.
Namespace
cm
.
Labels
[
nvidiacomv1beta1
.
LabelManagedBy
]
=
nvidiacomv1beta1
.
LabelValueDynamoOperator
// Create the ConfigMap
if
err
:=
r
.
Create
(
ctx
,
cm
);
err
!=
nil
{
if
apierrors
.
IsAlreadyExists
(
err
)
{
logger
.
Info
(
"ConfigMap already exists, skipping"
,
"name"
,
cm
.
Name
)
}
else
{
return
fmt
.
Errorf
(
"failed to create ConfigMap %s: %w"
,
cm
.
Name
,
err
)
}
}
else
{
logger
.
Info
(
"Created ConfigMap from profiling output"
,
"name"
,
cm
.
Name
,
"namespace"
,
targetNamespace
)
// Use SyncResource to create/update the ConfigMap with owner reference and change detection
_
,
_
,
err
:=
commonController
.
SyncResource
(
ctx
,
r
,
dgdr
,
func
(
ctx
context
.
Context
)
(
*
corev1
.
ConfigMap
,
bool
,
error
)
{
return
cm
,
false
,
nil
})
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to sync ConfigMap %s: %w"
,
cm
.
Name
,
err
)
}
logger
.
Info
(
"Synced ConfigMap from profiling output"
,
"name"
,
cm
.
Name
,
"namespace"
,
targetNamespace
)
}
if
resourceCount
>
0
{
...
...
@@ -1270,6 +1282,7 @@ func (r *DynamoGraphDeploymentRequestReconciler) createProfilingJob(ctx context.
"ConfigMapName"
:
outputConfigMapName
,
"Namespace"
:
dgdr
.
Namespace
,
"DGDRName"
:
dgdr
.
Name
,
"DGDRuid"
:
string
(
dgdr
.
UID
),
})
if
err
!=
nil
{
return
nil
,
false
,
fmt
.
Errorf
(
"failed to execute sidecar script template: %w"
,
err
)
...
...
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