This is an automated email from the ASF dual-hosted git repository.

squakez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 8a236f5572840ea247e716604c7289da9400d46d
Author: Luis Sergio Carneiro <[email protected]>
AuthorDate: Sun Sep 6 11:05:30 2026 -0300

    Fix #6797: Disable enableServiceLinks on operator and builder pods
    
    Sets enableServiceLinks: false on the camel-k-operator Deployment's pod
    spec (base manifest and Helm chart) and on the builder Pods created by
    the pod build strategy. Both pod kinds are internal to camel-k and have
    no use for Docker-links-style service env injection, so they should not
    be exposed to the same E2BIG "argument list too long" failure mode that
    #6724 fixed for user Integrations by making enableServiceLinks
    configurable there.
    
    Co-Authored-By: Claude Sonnet 5 <[email protected]>
---
 helm/camel-k/templates/operator-deployment.yaml       | 1 +
 pkg/controller/build/build_pod.go                     | 2 ++
 pkg/controller/build/build_pod_test.go                | 2 ++
 pkg/resources/config/manager/operator-deployment.yaml | 1 +
 4 files changed, 6 insertions(+)

diff --git a/helm/camel-k/templates/operator-deployment.yaml 
b/helm/camel-k/templates/operator-deployment.yaml
index 57944ddfe..56ea2942f 100644
--- a/helm/camel-k/templates/operator-deployment.yaml
+++ b/helm/camel-k/templates/operator-deployment.yaml
@@ -45,6 +45,7 @@ spec:
       imagePullSecrets:
 {{ toYaml .Values.operator.imagePullSecrets | indent 8 }}
     {{- end }}
+      enableServiceLinks: false
 
       containers:
         - command:
diff --git a/pkg/controller/build/build_pod.go 
b/pkg/controller/build/build_pod.go
index 734529ff0..5044f843b 100644
--- a/pkg/controller/build/build_pod.go
+++ b/pkg/controller/build/build_pod.go
@@ -25,6 +25,7 @@ import (
        corev1 "k8s.io/api/core/v1"
        k8serrors "k8s.io/apimachinery/pkg/api/errors"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+       "k8s.io/utils/ptr"
        ctrl "sigs.k8s.io/controller-runtime/pkg/client"
 
        v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
@@ -76,6 +77,7 @@ func newBuildPod(ctx context.Context, client client.Client, 
build *v1.Build) *co
                        RestartPolicy:      corev1.RestartPolicyNever,
                        SecurityContext:    podSecurityContext,
                        NodeSelector:       
build.BuilderConfiguration().NodeSelector,
+                       EnableServiceLinks: ptr.To(false),
                },
        }
 
diff --git a/pkg/controller/build/build_pod_test.go 
b/pkg/controller/build/build_pod_test.go
index 6f894d05a..ebab005e6 100644
--- a/pkg/controller/build/build_pod_test.go
+++ b/pkg/controller/build/build_pod_test.go
@@ -65,4 +65,6 @@ func TestNewBuildPodConfiguration(t *testing.T) {
        }, pod.Labels)
        assert.Equal(t, map[string]string{"node": "selector"}, 
pod.Spec.NodeSelector)
        assert.Equal(t, map[string]string{"annotation": "value"}, 
pod.Annotations)
+       require.NotNil(t, pod.Spec.EnableServiceLinks)
+       assert.False(t, *pod.Spec.EnableServiceLinks)
 }
diff --git a/pkg/resources/config/manager/operator-deployment.yaml 
b/pkg/resources/config/manager/operator-deployment.yaml
index bfcd8d051..771d21d53 100644
--- a/pkg/resources/config/manager/operator-deployment.yaml
+++ b/pkg/resources/config/manager/operator-deployment.yaml
@@ -44,6 +44,7 @@ spec:
         app.kubernetes.io/version: "2.12.0-SNAPSHOT"
     spec:
       serviceAccountName: camel-k-operator
+      enableServiceLinks: false
       containers:
         - name: camel-k-operator
           image: docker.io/apache/camel-k:2.12.0-SNAPSHOT

Reply via email to