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

pcongiusti pushed a commit to branch release-2.9.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit f62c220e933e72dfc30a5b7013e5ab4cabfd4a52
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Sat Feb 7 09:45:19 2026 +0100

    fix(trait): remove default params from status
    
    Closes #6478
---
 helm/camel-k/crds/camel-k-crds.yaml                | 64 ----------------------
 pkg/apis/camel/v1/trait/gitops.go                  |  5 --
 .../camel.apache.org_integrationplatforms.yaml     | 16 ------
 .../camel.apache.org_integrationprofiles.yaml      | 16 ------
 .../crd/bases/camel.apache.org_integrations.yaml   | 16 ------
 .../config/crd/bases/camel.apache.org_pipes.yaml   | 16 ------
 pkg/trait/gitops.go                                | 53 ++++++++++++++++--
 7 files changed, 47 insertions(+), 139 deletions(-)

diff --git a/helm/camel-k/crds/camel-k-crds.yaml 
b/helm/camel-k/crds/camel-k-crds.yaml
index 84cb8ad48..a600c2e94 100644
--- a/helm/camel-k/crds/camel-k-crds.yaml
+++ b/helm/camel-k/crds/camel-k-crds.yaml
@@ -4345,12 +4345,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -4365,21 +4363,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
@@ -6766,12 +6758,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -6786,21 +6776,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
@@ -9089,12 +9073,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -9109,21 +9091,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
@@ -11389,12 +11365,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -11409,21 +11383,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
@@ -20523,12 +20491,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -20543,21 +20509,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
@@ -22777,12 +22737,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -22797,21 +22755,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
@@ -33272,12 +33224,10 @@ spec:
                             description: the git commit (full SHA) to check 
out.
                             type: string
                           committerEmail:
-                            default: [email protected]
                             description: The email used to commit the GitOps 
changes
                               (default `[email protected]`).
                             type: string
                           committerName:
-                            default: Camel K Operator
                             description: The name used to commit the GitOps 
changes
                               (default `Camel K Operator`).
                             type: string
@@ -33292,21 +33242,15 @@ spec:
                               All traits share this common property.
                             type: boolean
                           integrationDirectory:
-                            default: integrations
                             description: The root path where to store 
Kustomize overlays
                               (default `integrations`).
                             type: string
                           overlays:
-                            default:
-                            - dev
-                            - stag
-                            - prod
                             description: a list of overlays to provide 
(default {"dev","stag","prod"}).
                             items:
                               type: string
                             type: array
                           overwriteOverlay:
-                            default: false
                             description: a flag (default, false) to overwrite 
any
                               existing overlay.
                             type: boolean
@@ -35459,12 +35403,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -35479,21 +35421,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
diff --git a/pkg/apis/camel/v1/trait/gitops.go 
b/pkg/apis/camel/v1/trait/gitops.go
index b6d406278..203e98ea1 100644
--- a/pkg/apis/camel/v1/trait/gitops.go
+++ b/pkg/apis/camel/v1/trait/gitops.go
@@ -38,18 +38,13 @@ type GitOpsTrait struct {
        // the git branch to push to. If omitted, the operator will push to a 
new branch named as `cicd/release-candidate-<datetime>`.
        BranchPush string `json:"branchPush,omitempty" property:"branch-push"`
        // a list of overlays to provide (default {"dev","stag","prod"}).
-       // +kubebuilder:default={"dev","stag","prod"}
        Overlays []string `json:"overlays,omitempty" property:"overlays"`
        // a flag (default, false) to overwrite any existing overlay.
-       // +kubebuilder:default=false
        OverwriteOverlay bool `json:"overwriteOverlay,omitempty" 
property:"overwrite-overlay"`
        // The root path where to store Kustomize overlays (default 
`integrations`).
-       // +kubebuilder:default="integrations"
        IntegrationDirectory string `json:"integrationDirectory,omitempty" 
property:"integration-directory"`
        // The name used to commit the GitOps changes (default `Camel K 
Operator`).
-       // +kubebuilder:default="Camel K Operator"
        CommiterName string `json:"committerName,omitempty" 
property:"committed-name"`
        // The email used to commit the GitOps changes (default 
`[email protected]`).
-       // +kubebuilder:default="[email protected]"
        CommiterEmail string `json:"committerEmail,omitempty" 
property:"committed-email"`
 }
diff --git 
a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml 
b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
index dec9e1fdb..d6e1f4231 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationplatforms.yaml
@@ -1096,12 +1096,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -1116,21 +1114,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
@@ -3517,12 +3509,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -3537,21 +3527,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
diff --git 
a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml 
b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
index e2e672585..9c023a8d6 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
@@ -964,12 +964,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -984,21 +982,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
@@ -3264,12 +3256,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -3284,21 +3274,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
diff --git a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml 
b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
index c88edef29..b971ddedf 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrations.yaml
@@ -7778,12 +7778,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -7798,21 +7796,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
@@ -10032,12 +10024,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -10052,21 +10042,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
diff --git a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml 
b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
index 975a1eca2..e3504f7f6 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
@@ -7833,12 +7833,10 @@ spec:
                             description: the git commit (full SHA) to check 
out.
                             type: string
                           committerEmail:
-                            default: [email protected]
                             description: The email used to commit the GitOps 
changes
                               (default `[email protected]`).
                             type: string
                           committerName:
-                            default: Camel K Operator
                             description: The name used to commit the GitOps 
changes
                               (default `Camel K Operator`).
                             type: string
@@ -7853,21 +7851,15 @@ spec:
                               All traits share this common property.
                             type: boolean
                           integrationDirectory:
-                            default: integrations
                             description: The root path where to store 
Kustomize overlays
                               (default `integrations`).
                             type: string
                           overlays:
-                            default:
-                            - dev
-                            - stag
-                            - prod
                             description: a list of overlays to provide 
(default {"dev","stag","prod"}).
                             items:
                               type: string
                             type: array
                           overwriteOverlay:
-                            default: false
                             description: a flag (default, false) to overwrite 
any
                               existing overlay.
                             type: boolean
@@ -10020,12 +10012,10 @@ spec:
                         description: the git commit (full SHA) to check out.
                         type: string
                       committerEmail:
-                        default: [email protected]
                         description: The email used to commit the GitOps 
changes (default
                           `[email protected]`).
                         type: string
                       committerName:
-                        default: Camel K Operator
                         description: The name used to commit the GitOps 
changes (default
                           `Camel K Operator`).
                         type: string
@@ -10040,21 +10030,15 @@ spec:
                           traits share this common property.
                         type: boolean
                       integrationDirectory:
-                        default: integrations
                         description: The root path where to store Kustomize 
overlays
                           (default `integrations`).
                         type: string
                       overlays:
-                        default:
-                        - dev
-                        - stag
-                        - prod
                         description: a list of overlays to provide (default 
{"dev","stag","prod"}).
                         items:
                           type: string
                         type: array
                       overwriteOverlay:
-                        default: false
                         description: a flag (default, false) to overwrite any 
existing
                           overlay.
                         type: boolean
diff --git a/pkg/trait/gitops.go b/pkg/trait/gitops.go
index 58a4eab5b..936ca930d 100644
--- a/pkg/trait/gitops.go
+++ b/pkg/trait/gitops.go
@@ -135,7 +135,7 @@ func (t *gitOpsTrait) pushGitOpsItInGitRepo(ctx 
context.Context, it *v1.Integrat
        }
 
        // Generate Kustomize content (it may override upstream content)
-       ciCdDir := filepath.Join(dir, t.IntegrationDirectory)
+       ciCdDir := filepath.Join(dir, t.getIntegrationsDirectory())
        err = os.MkdirAll(ciCdDir, io.FilePerm755)
        if err != nil {
                return err
@@ -146,23 +146,23 @@ func (t *gitOpsTrait) pushGitOpsItInGitRepo(ctx 
context.Context, it *v1.Integrat
                return err
        }
 
-       for _, overlay := range t.Overlays {
+       for _, overlay := range t.getOverlays() {
                destIntegration := util.EditIntegration(it, kit, overlay, "")
-               err = util.AppendKustomizeIntegration(destIntegration, ciCdDir, 
t.OverwriteOverlay)
+               err = util.AppendKustomizeIntegration(destIntegration, ciCdDir, 
t.getOverwriteOverlay())
                if err != nil {
                        return err
                }
        }
 
        // Commit and push new content
-       _, err = w.Add(t.IntegrationDirectory)
+       _, err = w.Add(t.getIntegrationsDirectory())
        if err != nil {
                return err
        }
        _, err = w.Commit(commitMessage, &git.CommitOptions{
                Author: &object.Signature{
-                       Name:  t.CommiterName,
-                       Email: t.CommiterEmail,
+                       Name:  t.getCommitterName(),
+                       Email: t.getCommitterEmail(),
                        When:  time.Now(),
                },
        })
@@ -227,3 +227,44 @@ func (t *gitOpsTrait) gitConf(it *v1.Integration) 
v1.GitConfigSpec {
 
        return gitConf
 }
+
+// Return the trait overlays or a default value.
+func (t *gitOpsTrait) getOverlays() []string {
+       if t.Overlays == nil {
+               return []string{"dev", "stag", "prod"}
+       }
+
+       return t.Overlays
+}
+
+// Return the trait overwrite overlay parameter or a default value.
+func (t *gitOpsTrait) getOverwriteOverlay() bool {
+       return t.OverwriteOverlay
+}
+
+// Return the trait Integrations directory parameter or a default value.
+func (t *gitOpsTrait) getIntegrationsDirectory() string {
+       if t.IntegrationDirectory == "" {
+               return "integrations"
+       }
+
+       return t.IntegrationDirectory
+}
+
+// Return the trait committer name parameter or a default value.
+func (t *gitOpsTrait) getCommitterName() string {
+       if t.CommiterName == "" {
+               return "Camel K Operator"
+       }
+
+       return t.CommiterName
+}
+
+// Return the trait committer email parameter or a default value.
+func (t *gitOpsTrait) getCommitterEmail() string {
+       if t.CommiterEmail == "" {
+               return "[email protected]"
+       }
+
+       return t.CommiterEmail
+}

Reply via email to