You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "tdiesler (via GitHub)" <gi...@apache.org> on 2024/06/03 15:16:25 UTC

[PR] (#5545) Add a canonical script that installs Knative [camel-k]

tdiesler opened a new pull request, #5573:
URL: https://github.com/apache/camel-k/pull/5573

   <!-- Description -->
   
   
   
   
   <!--
   Enter your extended release note in the below block. If the PR requires
   additional action from users switching to the new release, include the string
   "action required". If no release note is required, write "NONE". 
   
   You can (optionally) mark this PR with labels "kind/bug" or "kind/feature" to make sure
   the text is added to the right section of the release notes. 
   -->
   
   **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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on code in PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#discussion_r1624862817


##########
e2e/knative/files/setup.sh:
##########
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Knative setup
+#
+####
+
+KNATIVE_VERSION=1.14.0
+YQ_VERSION=4.44.1
+
+TIMEOUT="150s"
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+# Check/Install: yq
+#
+
+SUDO=${SUDO:-sudo}
+
+echo -n "Checking yq ... "
+if which yq > /dev/null 2>&1; then
+  echo "ok"
+else
+  yq="yq_${OS}_${ARCH}"
+  echo "installing ${yq}-v${YQ_VERSION}"
+  ${SUDO} wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/${yq} -O /usr/bin/yq && ${SUDO} chmod +x /usr/bin/yq

Review Comment:
   At this stage, the script will fail with a detailed message when something goes wrong. In case you want to have control over the install dir, you can always provide yq your self before you run the script - e.g. I did `brew install yq`
   
   Perhaps you have some other security concern that I'm missing here, have 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.

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

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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#issuecomment-2147647862

   Yes, the checks were failing because it required a rebase after 2.3.2 release. Merging anyway.


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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#issuecomment-2146828540

   > IIUC, this would require the user to run previously the script as well, is that right? In such case I think we should update the documentation to reflect the change and let the user know how to properly run the test.
   
   The script is optional - if you have knative installed already, it does nothing (except to report that it already found the knative namespaces). 


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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on code in PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#discussion_r1624868846


##########
e2e/knative/files/setup.sh:
##########
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Knative setup
+#
+####
+
+KNATIVE_VERSION=1.14.0
+YQ_VERSION=4.44.1
+
+TIMEOUT="150s"
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+# Check/Install: yq
+#
+
+SUDO=${SUDO:-sudo}
+
+echo -n "Checking yq ... "
+if which yq > /dev/null 2>&1; then
+  echo "ok"
+else
+  yq="yq_${OS}_${ARCH}"
+  echo "installing ${yq}-v${YQ_VERSION}"
+  ${SUDO} wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/${yq} -O /usr/bin/yq && ${SUDO} chmod +x /usr/bin/yq

Review Comment:
   On GitHub, I see ...
   
   ```
   Checking yq ... ok
   ```
   
   We could perhaps require to have yq installed as a prerequisite like wget, kubectl



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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez merged PR #5573:
URL: https://github.com/apache/camel-k/pull/5573


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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on code in PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#discussion_r1624862817


##########
e2e/knative/files/setup.sh:
##########
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Knative setup
+#
+####
+
+KNATIVE_VERSION=1.14.0
+YQ_VERSION=4.44.1
+
+TIMEOUT="150s"
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+# Check/Install: yq
+#
+
+SUDO=${SUDO:-sudo}
+
+echo -n "Checking yq ... "
+if which yq > /dev/null 2>&1; then
+  echo "ok"
+else
+  yq="yq_${OS}_${ARCH}"
+  echo "installing ${yq}-v${YQ_VERSION}"
+  ${SUDO} wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/${yq} -O /usr/bin/yq && ${SUDO} chmod +x /usr/bin/yq

Review Comment:
   At this stage, the script will fail with a detailed message when something goes wrong. In case you want to have control over the install dir, you can always provide yq your self before you run the script.
   e.g. I did `brew install yq`
   
   Perhaps you have some other security concern that I'm missing here, have 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.

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

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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#issuecomment-2147113480

   rebased, please give this another shot


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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on code in PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#discussion_r1625445606


##########
e2e/knative/files/setup.sh:
##########
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Knative setup
+#
+####
+
+KNATIVE_VERSION=1.14.0
+YQ_VERSION=4.44.1
+
+TIMEOUT="150s"
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+# Check/Install: yq
+#
+
+SUDO=${SUDO:-sudo}
+
+echo -n "Checking yq ... "
+if which yq > /dev/null 2>&1; then
+  echo "ok"
+else
+  yq="yq_${OS}_${ARCH}"
+  echo "installing ${yq}-v${YQ_VERSION}"
+  ${SUDO} wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/${yq} -O /usr/bin/yq && ${SUDO} chmod +x /usr/bin/yq

Review Comment:
   FWIW and probably too late, a way of providing additional software (especially if it can be installed by go install) is to install it in the local bin folder, as an example https://github.com/dapr-sandbox/dapr-kubernetes-operator/blob/main/Makefile#L313-L317. 
   
   The reason to install a specific version  is that sometime the one provided by the os distribution may be outdated and not working as expected.



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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on code in PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#discussion_r1625420117


##########
e2e/knative/files/setup.sh:
##########
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Knative setup
+#
+####
+
+KNATIVE_VERSION=1.14.0
+YQ_VERSION=4.44.1
+
+TIMEOUT="150s"
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+# Check/Install: yq
+#
+
+SUDO=${SUDO:-sudo}
+
+echo -n "Checking yq ... "
+if which yq > /dev/null 2>&1; then
+  echo "ok"
+else
+  yq="yq_${OS}_${ARCH}"
+  echo "installing ${yq}-v${YQ_VERSION}"
+  ${SUDO} wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/${yq} -O /usr/bin/yq && ${SUDO} chmod +x /usr/bin/yq

Review Comment:
   Removed the yq install, which is now the only dependency



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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on code in PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#discussion_r1624862817


##########
e2e/knative/files/setup.sh:
##########
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Knative setup
+#
+####
+
+KNATIVE_VERSION=1.14.0
+YQ_VERSION=4.44.1
+
+TIMEOUT="150s"
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+# Check/Install: yq
+#
+
+SUDO=${SUDO:-sudo}
+
+echo -n "Checking yq ... "
+if which yq > /dev/null 2>&1; then
+  echo "ok"
+else
+  yq="yq_${OS}_${ARCH}"
+  echo "installing ${yq}-v${YQ_VERSION}"
+  ${SUDO} wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/${yq} -O /usr/bin/yq && ${SUDO} chmod +x /usr/bin/yq

Review Comment:
   At this stage, the script will fail with a detailed message when something goes wrong. In case you want to have more control over the install dir, you can always provide yq yourself before you run the script.
   e.g. I did `brew install yq`
   
   Perhaps you have some other security concern that I'm missing here, have 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.

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

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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#issuecomment-2147608864

   repeatedly fails in 
   
   ```
   ❌ TestOLMOperatorUpgrade (16m29.34s)
   ❌ TestOLMOperatorUpgrade/OLM_upgrade (10m0.03s)
   ```


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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "claudio4j (via GitHub)" <gi...@apache.org>.
claudio4j commented on code in PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#discussion_r1624909641


##########
e2e/knative/files/setup.sh:
##########
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Knative setup
+#
+####
+
+KNATIVE_VERSION=1.14.0
+YQ_VERSION=4.44.1
+
+TIMEOUT="150s"
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+# Check/Install: yq
+#
+
+SUDO=${SUDO:-sudo}
+
+echo -n "Checking yq ... "
+if which yq > /dev/null 2>&1; then
+  echo "ok"
+else
+  yq="yq_${OS}_${ARCH}"
+  echo "installing ${yq}-v${YQ_VERSION}"
+  ${SUDO} wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/${yq} -O /usr/bin/yq && ${SUDO} chmod +x /usr/bin/yq

Review Comment:
   > We could perhaps require to have yq installed as a prerequisite like wget, kubectl
   
   That would be good, to document the list of required tools. 



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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#issuecomment-2147494313

   fails unrelated, pls try again


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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#issuecomment-2146836800

   > The script is optional - if you have knative installed already, it does nothing (except to report that it already found the knative namespaces).
   
   Good, then, we better reflect this in the documentation to let the user know how to properly run it.


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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "christophd (via GitHub)" <gi...@apache.org>.
christophd commented on PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#issuecomment-2146907966

   Sorry for being late to the party. I just wanted to mention the `kn-box` project that is maintained by the Knative committers: https://github.com/matzew/kn-box


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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "claudio4j (via GitHub)" <gi...@apache.org>.
claudio4j commented on code in PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#discussion_r1624833294


##########
e2e/knative/files/setup.sh:
##########
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Knative setup
+#
+####
+
+KNATIVE_VERSION=1.14.0
+YQ_VERSION=4.44.1
+
+TIMEOUT="150s"
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+# Check/Install: yq
+#
+
+SUDO=${SUDO:-sudo}
+
+echo -n "Checking yq ... "
+if which yq > /dev/null 2>&1; then
+  echo "ok"
+else
+  yq="yq_${OS}_${ARCH}"
+  echo "installing ${yq}-v${YQ_VERSION}"
+  ${SUDO} wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/${yq} -O /usr/bin/yq && ${SUDO} chmod +x /usr/bin/yq

Review Comment:
   It's important to show that the script is going to use sudo to install that into the protected `/usr/bin` directory, maybe an echo of the command is good.



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


Re: [PR] (#5545) Add a canonical script that installs Knative [camel-k]

Posted by "tdiesler (via GitHub)" <gi...@apache.org>.
tdiesler commented on code in PR #5573:
URL: https://github.com/apache/camel-k/pull/5573#discussion_r1624862817


##########
e2e/knative/files/setup.sh:
##########
@@ -0,0 +1,244 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Knative setup
+#
+####
+
+KNATIVE_VERSION=1.14.0
+YQ_VERSION=4.44.1
+
+TIMEOUT="150s"
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+# Check/Install: yq
+#
+
+SUDO=${SUDO:-sudo}
+
+echo -n "Checking yq ... "
+if which yq > /dev/null 2>&1; then
+  echo "ok"
+else
+  yq="yq_${OS}_${ARCH}"
+  echo "installing ${yq}-v${YQ_VERSION}"
+  ${SUDO} wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/${yq} -O /usr/bin/yq && ${SUDO} chmod +x /usr/bin/yq

Review Comment:
   At this stage, the script will fail with a detailed message when something goes wrong. In case you want to have more control over the install dir, you can always provide yq your self before you run the script.
   e.g. I did `brew install yq`
   
   Perhaps you have some other security concern that I'm missing here, have 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.

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

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