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/12/08 09:54:11 UTC

[GitHub] [camel-k] astefanutti opened a new pull request #2821: fix: First bundle Kamelets install with client-side apply

astefanutti opened a new pull request #2821:
URL: https://github.com/apache/camel-k/pull/2821


   Thanks to @zregvart that pointed out in #2814 the bundle Kamelets are not installed when falling back to client-side apply.
   
   **Release Note**
   ```release-note
   NONE
   ```
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-k] zregvart commented on a change in pull request #2821: fix: First bundle Kamelets install with client-side apply

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #2821:
URL: https://github.com/apache/camel-k/pull/2821#discussion_r764718481



##########
File path: pkg/install/kamelets.go
##########
@@ -125,14 +125,16 @@ func applyKamelet(ctx context.Context, c client.Client, path string, namespace s
 		err := serverSideApply(ctx, c, kamelet)
 		switch {
 		case err == nil:
-			break
+			return nil
 		case isIncompatibleServerError(err):
 			hasServerSideApply = false
 		default:
 			return fmt.Errorf("could not apply Kamelet from file %q: %w", path, err)
 		}
-	} else {
-		return clientSideApply(ctx, c, kamelet)
+	}
+	err = clientSideApply(ctx, c, kamelet)

Review comment:
       I think this could be invoked if `hasServerSideApply = true` and `err = nil` as well, in that case `serverSideApply` should have already created the resource and `clientSideApply` should not be invoked. Perhaps something like:
   
   ```suggestion
   	if hasServerSideApply == false {
   		err = clientSideApply(ctx, c, kamelet)
   	}
   ```




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-k] astefanutti merged pull request #2821: fix: First bundle Kamelets install with client-side apply

Posted by GitBox <gi...@apache.org>.
astefanutti merged pull request #2821:
URL: https://github.com/apache/camel-k/pull/2821


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-k] astefanutti commented on a change in pull request #2821: fix: First bundle Kamelets install with client-side apply

Posted by GitBox <gi...@apache.org>.
astefanutti commented on a change in pull request #2821:
URL: https://github.com/apache/camel-k/pull/2821#discussion_r764722014



##########
File path: pkg/install/kamelets.go
##########
@@ -125,14 +125,16 @@ func applyKamelet(ctx context.Context, c client.Client, path string, namespace s
 		err := serverSideApply(ctx, c, kamelet)
 		switch {
 		case err == nil:
-			break
+			return nil
 		case isIncompatibleServerError(err):
 			hasServerSideApply = false
 		default:
 			return fmt.Errorf("could not apply Kamelet from file %q: %w", path, err)
 		}
-	} else {
-		return clientSideApply(ctx, c, kamelet)
+	}
+	err = clientSideApply(ctx, c, kamelet)

Review comment:
       Ah, I've also changed the `err == nil` case for that reason, so that the switch branches all returns except the fallback to client-side apply.




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

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