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
283b20c9
Unverified
Commit
283b20c9
authored
Jan 15, 2026
by
Neelay Shah
Committed by
GitHub
Jan 15, 2026
Browse files
fix: apply labels to Kubernetes Service objects in operator (#5459)
Co-authored-by:
Claude Opus 4.5
<
noreply@anthropic.com
>
parent
d1545621
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
deploy/operator/internal/dynamo/graph.go
deploy/operator/internal/dynamo/graph.go
+14
-6
No files found.
deploy/operator/internal/dynamo/graph.go
View file @
283b20c9
...
@@ -567,10 +567,24 @@ func GenerateComponentService(ctx context.Context, dynamoDeployment *v1alpha1.Dy
...
@@ -567,10 +567,24 @@ func GenerateComponentService(ctx context.Context, dynamoDeployment *v1alpha1.Dy
Protocol
:
corev1
.
ProtocolTCP
,
Protocol
:
corev1
.
ProtocolTCP
,
}
}
}
}
// Start with user-defined labels from component.Labels
labels
:=
make
(
map
[
string
]
string
)
for
k
,
v
:=
range
component
.
Labels
{
labels
[
k
]
=
v
}
// Add k8s discovery labels (these take precedence over user labels)
if
isK8sDiscoveryEnabled
{
labels
[
commonconsts
.
KubeLabelDynamoDiscoveryBackend
]
=
"kubernetes"
labels
[
commonconsts
.
KubeLabelDynamoDiscoveryEnabled
]
=
commonconsts
.
KubeLabelValueTrue
}
service
:=
&
corev1
.
Service
{
service
:=
&
corev1
.
Service
{
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
componentName
,
Name
:
componentName
,
Namespace
:
dynamoDeployment
.
Namespace
,
Namespace
:
dynamoDeployment
.
Namespace
,
Labels
:
labels
,
},
},
Spec
:
corev1
.
ServiceSpec
{
Spec
:
corev1
.
ServiceSpec
{
Selector
:
map
[
string
]
string
{
Selector
:
map
[
string
]
string
{
...
@@ -580,12 +594,6 @@ func GenerateComponentService(ctx context.Context, dynamoDeployment *v1alpha1.Dy
...
@@ -580,12 +594,6 @@ func GenerateComponentService(ctx context.Context, dynamoDeployment *v1alpha1.Dy
Ports
:
[]
corev1
.
ServicePort
{
servicePort
},
Ports
:
[]
corev1
.
ServicePort
{
servicePort
},
},
},
}
}
if
isK8sDiscoveryEnabled
{
service
.
Labels
=
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoDiscoveryBackend
:
"kubernetes"
,
commonconsts
.
KubeLabelDynamoDiscoveryEnabled
:
commonconsts
.
KubeLabelValueTrue
,
}
}
return
service
,
nil
return
service
,
nil
}
}
...
...
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