You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:17:15 UTC

[GitHub] [camel-k] astefanutti commented on a change in pull request #2399: fix(trait): ImagePullSecrets are not configured when the Integration is running

astefanutti commented on a change in pull request #2399:
URL: https://github.com/apache/camel-k/pull/2399#discussion_r650166319



##########
File path: pkg/trait/pull_secret.go
##########
@@ -110,7 +110,7 @@ func (t *pullSecretTrait) Apply(e *Environment) error {
 			})
 		})
 	}
-	if util.IsTrue(t.ImagePullerDelegation) {
+	if util.IsTrue(t.ImagePullerDelegation) && e.IntegrationInPhase(v1.IntegrationPhaseDeploying) {

Review comment:
       Actually, thinking about this, I think we should refactor the `delegateImagePuller` method:
   * Add the RoleBinding to the environment resources, instead of manually creating it
   * Call the `delegateImagePuller` method in both deploying and running phase
   
   That way, we follow the idiomatic way of managing resources, and let the _deployer_ and _gc_ do their duties.

##########
File path: pkg/trait/pull_secret.go
##########
@@ -110,7 +110,7 @@ func (t *pullSecretTrait) Apply(e *Environment) error {
 			})
 		})
 	}
-	if util.IsTrue(t.ImagePullerDelegation) {
+	if util.IsTrue(t.ImagePullerDelegation) && e.IntegrationInPhase(v1.IntegrationPhaseDeploying) {

Review comment:
       Actually, thinking about this, I think we should refactor the `delegateImagePuller` method:
   * Add the RoleBinding to the environment resources, instead of manually creating it
   * Call the `delegateImagePuller` method in both deploying and running phase
   
   That way, we follow the idiomatic way of managing resources, and let the _deployer_ and _gc_ traits do their duties.

##########
File path: pkg/trait/pull_secret.go
##########
@@ -110,7 +110,7 @@ func (t *pullSecretTrait) Apply(e *Environment) error {
 			})
 		})
 	}
-	if util.IsTrue(t.ImagePullerDelegation) {
+	if util.IsTrue(t.ImagePullerDelegation) && e.IntegrationInPhase(v1.IntegrationPhaseDeploying) {

Review comment:
       Actually, thinking about this, I think we should refactor the `delegateImagePuller` method:
   * Add the RoleBinding to the environment resources, instead of manually creating it
   * Call the `delegateImagePuller` method in both deploying and running phase
   
   That way, we follow the idiomatic way of managing resources, and let the _deployer_ and _GC_ traits do their duties.

##########
File path: pkg/trait/pull_secret.go
##########
@@ -110,7 +110,7 @@ func (t *pullSecretTrait) Apply(e *Environment) error {
 			})
 		})
 	}
-	if util.IsTrue(t.ImagePullerDelegation) {
+	if util.IsTrue(t.ImagePullerDelegation) && e.IntegrationInPhase(v1.IntegrationPhaseDeploying) {

Review comment:
       Actually, thinking about this, I think we should refactor the `delegateImagePuller` method:
   * Add the RoleBinding to the environment resources, instead of manually creating it
   * Call the `delegateImagePuller` method in both deploying and running phase
   
   That way, we follow the idiomatic way of managing resources, and let the _Deployer_ and _GC_ traits do their duties.

##########
File path: pkg/trait/pull_secret.go
##########
@@ -110,7 +110,7 @@ func (t *pullSecretTrait) Apply(e *Environment) error {
 			})
 		})
 	}
-	if util.IsTrue(t.ImagePullerDelegation) {
+	if util.IsTrue(t.ImagePullerDelegation) && e.IntegrationInPhase(v1.IntegrationPhaseDeploying) {

Review comment:
       Actually, thinking about this, I think we should refactor the `delegateImagePuller` method:
   * Add the RoleBinding to the environment resources, instead of manually creating it
   * Call the `delegateImagePuller` method in both deploying and running phase
   
   That way, we follow the idiomatic way of managing resources, and let the _Deployer_, _Owner_, and _GC_ traits do their duties.

##########
File path: pkg/trait/pull_secret.go
##########
@@ -110,7 +110,7 @@ func (t *pullSecretTrait) Apply(e *Environment) error {
 			})
 		})
 	}
-	if util.IsTrue(t.ImagePullerDelegation) {
+	if util.IsTrue(t.ImagePullerDelegation) && e.IntegrationInPhase(v1.IntegrationPhaseDeploying) {

Review comment:
       Thanks, I agree with you 👍🏼.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org