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 546759fed1bbd82240c274253dd5dbd0b2a697bf
Author: Antonin Stefanutti <[email protected]>
AuthorDate: Thu Aug 19 16:30:11 2021 +0200

    chore(native): Remove unused IntegrationPhaseResolvingKit phase
---
 pkg/apis/camel/v1/integration_types.go  | 5 ++---
 pkg/controller/integration/build_kit.go | 3 +--
 pkg/trait/deployer.go                   | 5 ++---
 pkg/trait/deployer_test.go              | 2 +-
 pkg/trait/deployment_test.go            | 2 +-
 pkg/trait/prometheus_test.go            | 2 +-
 6 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/pkg/apis/camel/v1/integration_types.go 
b/pkg/apis/camel/v1/integration_types.go
index 79005f6..32125c8 100644
--- a/pkg/apis/camel/v1/integration_types.go
+++ b/pkg/apis/camel/v1/integration_types.go
@@ -116,9 +116,8 @@ const (
        IntegrationPhaseWaitingForPlatform IntegrationPhase = "Waiting For 
Platform"
        // IntegrationPhaseBuildingKit --
        IntegrationPhaseBuildingKit IntegrationPhase = "Building Kit"
-       // IntegrationPhaseResolvingKit --
-       IntegrationPhaseResolvingKit IntegrationPhase = "Resolving Kit"
-       // IntegrationPhaseWaitingForBindings e.g Service Bindings --
+       // IntegrationPhaseWaitingForBindings means the Integration is 
currently waiting to be bound
+       // to other resources, e.g., Service Bindings.
        IntegrationPhaseWaitingForBindings IntegrationPhase = "Waiting for 
Bindings"
        // IntegrationPhaseDeploying --
        IntegrationPhaseDeploying IntegrationPhase = "Deploying"
diff --git a/pkg/controller/integration/build_kit.go 
b/pkg/controller/integration/build_kit.go
index cb2919c..fbb665a 100644
--- a/pkg/controller/integration/build_kit.go
+++ b/pkg/controller/integration/build_kit.go
@@ -51,8 +51,7 @@ func (action *buildKitAction) Name() string {
 }
 
 func (action *buildKitAction) CanHandle(integration *v1.Integration) bool {
-       return integration.Status.Phase == v1.IntegrationPhaseBuildingKit ||
-               integration.Status.Phase == v1.IntegrationPhaseResolvingKit
+       return integration.Status.Phase == v1.IntegrationPhaseBuildingKit
 }
 
 func (action *buildKitAction) Handle(ctx context.Context, integration 
*v1.Integration) (*v1.Integration, error) {
diff --git a/pkg/trait/deployer.go b/pkg/trait/deployer.go
index 301d7d0..609519c 100644
--- a/pkg/trait/deployer.go
+++ b/pkg/trait/deployer.go
@@ -60,7 +60,6 @@ func (t *deployerTrait) Configure(e *Environment) (bool, 
error) {
                v1.IntegrationPhaseWaitingForPlatform,
                v1.IntegrationPhaseInitialization,
                v1.IntegrationPhaseBuildingKit,
-               v1.IntegrationPhaseResolvingKit,
                v1.IntegrationPhaseDeploying,
                v1.IntegrationPhaseRunning,
        ), nil
@@ -69,7 +68,7 @@ func (t *deployerTrait) Configure(e *Environment) (bool, 
error) {
 func (t *deployerTrait) Apply(e *Environment) error {
        switch e.Integration.Status.Phase {
 
-       case v1.IntegrationPhaseBuildingKit, v1.IntegrationPhaseResolvingKit:
+       case v1.IntegrationPhaseBuildingKit:
                if e.IntegrationKitInPhase(v1.IntegrationKitPhaseReady) {
                        e.PostProcessors = append(e.PostProcessors, 
func(environment *Environment) error {
                                // trigger integration deploy
@@ -89,7 +88,7 @@ func (t *deployerTrait) Apply(e *Environment) error {
                                // is enabled. This is possible to fetch the 
OpenAPI endpoint, which returns
                                // the entire server API document, then lookup 
the resource PATCH endpoint, and
                                // check its list of accepted MIME types.
-                               // As a simpler solution, we fallback to 
client-side apply at the first
+                               // As a simpler solution, we fall back to 
client-side apply at the first
                                // 415 error, and assume server-side apply is 
not available globally.
                                if hasServerSideApply {
                                        if err := t.serverSideApply(env, 
resource); err == nil {
diff --git a/pkg/trait/deployer_test.go b/pkg/trait/deployer_test.go
index d5ffb97..c595f2c 100644
--- a/pkg/trait/deployer_test.go
+++ b/pkg/trait/deployer_test.go
@@ -67,7 +67,7 @@ func TestApplyDeployerTraitInInitializationPhaseDoesSucceed(t 
*testing.T) {
 
 func TestApplyDeployerTraitInResolvingKitPhaseSkipPostActions(t *testing.T) {
        deployerTrait, environment := createNominalDeployerTest()
-       environment.Integration.Status.Phase = v1.IntegrationPhaseResolvingKit
+       environment.Integration.Status.Phase = v1.IntegrationPhaseBuildingKit
 
        err := deployerTrait.Apply(environment)
 
diff --git a/pkg/trait/deployment_test.go b/pkg/trait/deployment_test.go
index a84ca82..f4fdd7a 100644
--- a/pkg/trait/deployment_test.go
+++ b/pkg/trait/deployment_test.go
@@ -93,7 +93,7 @@ func 
TestConfigureDeploymentTraitWhileWaitingPlatformDoesNotSucceed(t *testing.T
 
 func TestApplyDeploymentTraitWhileResolvingKitDoesNotSucceed(t *testing.T) {
        deploymentTrait, environment := createNominalDeploymentTest()
-       environment.Integration.Status.Phase = v1.IntegrationPhaseResolvingKit
+       environment.Integration.Status.Phase = v1.IntegrationPhaseBuildingKit
 
        configured, err := deploymentTrait.Configure(environment)
 
diff --git a/pkg/trait/prometheus_test.go b/pkg/trait/prometheus_test.go
index 670a911..fbf244b 100644
--- a/pkg/trait/prometheus_test.go
+++ b/pkg/trait/prometheus_test.go
@@ -45,7 +45,7 @@ func TestConfigurePrometheusTraitInRightPhaseDoesSucceed(t 
*testing.T) {
 
 func TestConfigurePrometheusTraitInWrongPhaseDoesNotSucceed(t *testing.T) {
        trait, environment := createNominalPrometheusTest()
-       environment.Integration.Status.Phase = v1.IntegrationPhaseResolvingKit
+       environment.Integration.Status.Phase = v1.IntegrationPhaseBuildingKit
 
        configured, err := trait.Configure(environment)
 

Reply via email to