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

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

commit 8bc854e8b57fddeafc2514e4f533c9ef2b015d42
Author: Antonin Stefanutti <anto...@stefanutti.fr>
AuthorDate: Thu Oct 7 15:36:00 2021 +0200

    chore: Apply master and threescale traits during error phase
---
 addons/master/master.go     | 5 ++---
 addons/threescale/3scale.go | 6 +++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/addons/master/master.go b/addons/master/master.go
index 119cf85..8d56e48 100644
--- a/addons/master/master.go
+++ b/addons/master/master.go
@@ -85,7 +85,7 @@ func (t *masterTrait) Configure(e *trait.Environment) (bool, 
error) {
                return false, nil
        }
 
-       if !e.IntegrationInPhase(v1.IntegrationPhaseInitialization, 
v1.IntegrationPhaseDeploying, v1.IntegrationPhaseRunning) {
+       if !e.IntegrationInPhase(v1.IntegrationPhaseInitialization) && 
!e.IntegrationInRunningPhases() {
                return false, nil
        }
 
@@ -157,7 +157,6 @@ func (t *masterTrait) Configure(e *trait.Environment) 
(bool, error) {
 }
 
 func (t *masterTrait) Apply(e *trait.Environment) error {
-
        if e.IntegrationInPhase(v1.IntegrationPhaseInitialization) {
                util.StringSliceUniqueAdd(&e.Integration.Status.Capabilities, 
v1.CapabilityMaster)
 
@@ -166,7 +165,7 @@ func (t *masterTrait) Apply(e *trait.Environment) error {
                        
util.StringSliceUniqueAdd(&e.Integration.Status.Dependencies, dep)
                }
 
-       } else if e.IntegrationInPhase(v1.IntegrationPhaseDeploying, 
v1.IntegrationPhaseRunning) {
+       } else if e.IntegrationInRunningPhases() {
                serviceAccount := e.Integration.Spec.ServiceAccountName
                if serviceAccount == "" {
                        serviceAccount = "default"
diff --git a/addons/threescale/3scale.go b/addons/threescale/3scale.go
index 41c6b45..d05fcb6 100644
--- a/addons/threescale/3scale.go
+++ b/addons/threescale/3scale.go
@@ -20,9 +20,9 @@ package threescale
 import (
        "strconv"
 
-       v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
-       "github.com/apache/camel-k/pkg/trait"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+       "github.com/apache/camel-k/pkg/trait"
 )
 
 // The 3scale trait can be used to automatically create annotations that allow
@@ -85,7 +85,7 @@ func (t *threeScaleTrait) Configure(e *trait.Environment) 
(bool, error) {
                return false, nil
        }
 
-       if !e.IntegrationInPhase(v1.IntegrationPhaseDeploying) {
+       if !e.IntegrationInRunningPhases() {
                return false, nil
        }
 

Reply via email to