You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "ricardozanini (via GitHub)" <gi...@apache.org> on 2024/08/06 20:59:24 UTC

Re: [PR] kie-issues#1337: kn-plugin-workflow should verify if the cluster has Knative installed [incubator-kie-tools]

ricardozanini commented on code in PR #2446:
URL: https://github.com/apache/incubator-kie-tools/pull/2446#discussion_r1706107159


##########
packages/kn-plugin-workflow/pkg/command/deploy.go:
##########
@@ -188,6 +188,14 @@ func runDeployCmdConfig(cmd *cobra.Command) (cfg DeployUndeployCmdConfig, err er
 		return cfg, fmt.Errorf("❌ ERROR: failed to get default dashboards files folder: %w", err)
 	}
 
+	// check if sonataflow operator CRDs are installed
+	crds := []string{"sonataflowbuilds.sonataflow.org", "sonataflowclusterplatforms.sonataflow.org", "sonataflowplatforms.sonataflow.org", "sonataflows.sonataflow.org"}
+	for _, crd := range crds {
+		if !common.CheckKubectlCrdExists(crd) {
+			return cfg, fmt.Errorf("❌ ERROR: the required CRDs are not installed.. Install the SonataFlow Operator CRD first")

Review Comment:
   nitpick: you may move these strings to a const since you might have to use them again in the future.



##########
packages/kn-plugin-workflow/pkg/command/deploy.go:
##########
@@ -188,6 +188,14 @@ func runDeployCmdConfig(cmd *cobra.Command) (cfg DeployUndeployCmdConfig, err er
 		return cfg, fmt.Errorf("❌ ERROR: failed to get default dashboards files folder: %w", err)
 	}
 
+	// check if sonataflow operator CRDs are installed
+	crds := []string{"sonataflowbuilds.sonataflow.org", "sonataflowclusterplatforms.sonataflow.org", "sonataflowplatforms.sonataflow.org", "sonataflows.sonataflow.org"}
+	for _, crd := range crds {
+		if !common.CheckKubectlCrdExists(crd) {
+			return cfg, fmt.Errorf("❌ ERROR: the required CRDs are not installed.. Install the SonataFlow Operator CRD first")

Review Comment:
   ```suggestion
   			return cfg, fmt.Errorf("❌ ERROR: the required CRDs are not installed. Install the SonataFlow Operator CRD first")
   ```



-- 
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@kie.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org