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 10:05:07 UTC

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

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