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


The following commit(s) were added to refs/heads/main by this push:
     new d52d9e4b3 feat(trait): don't use environment pull secret
d52d9e4b3 is described below

commit d52d9e4b33402085d18b522bcabf84c918428ac3
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Tue Aug 11 08:47:49 2026 +0200

    feat(trait): don't use environment pull secret
    
    Closes #6698
---
 pkg/trait/pull_secret.go | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/pkg/trait/pull_secret.go b/pkg/trait/pull_secret.go
index 8028d2cd0..f65151ee4 100644
--- a/pkg/trait/pull_secret.go
+++ b/pkg/trait/pull_secret.go
@@ -39,6 +39,9 @@ const (
 type pullSecretTrait struct {
        BaseTrait
        traitv1.PullSecretTrait `property:",squash"`
+
+       deprecatedImagePullerDelegation *bool
+       secretName                      string
 }
 
 func newPullSecretTrait() Trait {
@@ -65,17 +68,14 @@ func (t *pullSecretTrait) Configure(e *Environment) (bool, 
*TraitCondition, erro
                }
        }
 
+       t.secretName = t.SecretName
        //nolint:staticcheck
-       return t.SecretName != "" || ptr.Deref(t.ImagePullerDelegation, false), 
nil, nil
+       t.deprecatedImagePullerDelegation = t.ImagePullerDelegation
+
+       return t.secretName != "" || 
ptr.Deref(t.deprecatedImagePullerDelegation, false), nil, nil
 }
 func (t *pullSecretTrait) autoConfigure(e *Environment) error {
-       if t.SecretName == "" {
-               // By default, it uses the registry secret configuration
-               t.SecretName = e.Platform.Registry.Secret
-       }
-
-       //nolint:staticcheck
-       if t.ImagePullerDelegation == nil {
+       if t.deprecatedImagePullerDelegation == nil {
                var isOpenShift bool
                if t.Client != nil {
                        var err error
@@ -87,7 +87,7 @@ func (t *pullSecretTrait) autoConfigure(e *Environment) error 
{
                isOperatorGlobal := platform.IsCurrentOperatorGlobal()
                isKitExternal := 
e.Integration.GetIntegrationKitNamespace(e.Platform.CatalogNamespace) != 
e.Integration.Namespace
                needsDelegation := isOpenShift && isOperatorGlobal && 
isKitExternal
-               t.ImagePullerDelegation = &needsDelegation
+               t.deprecatedImagePullerDelegation = &needsDelegation
        }
 
        return nil
@@ -101,8 +101,8 @@ func (t *pullSecretTrait) Apply(e *Environment) error {
                        })
                })
        }
-       //nolint:staticcheck
-       if ptr.Deref(t.ImagePullerDelegation, false) {
+
+       if ptr.Deref(t.deprecatedImagePullerDelegation, false) {
                if err := t.delegateImagePuller(e); err != nil {
                        return err
                }

Reply via email to