You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/04/10 08:47:43 UTC

[camel-k] branch main updated (9be5abe00 -> 87f6b0c94)

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


    from 9be5abe00 chore(deps): bump github.com/container-tools/spectrum
     new 350c5fb1f fix(core): Fix copy local dependencies error message
     new 87f6b0c94 fix(e2e): Check copy to localRepository on install

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 e2e/install/cli/install_test.go | 35 +++++++++++++++++++++++++++++++++++
 pkg/install/optional.go         |  7 ++++++-
 2 files changed, 41 insertions(+), 1 deletion(-)


[camel-k] 02/02: fix(e2e): Check copy to localRepository on install

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 87f6b0c94a99ea5144d6f7fa41fd9ccd481be409
Author: Gaelle Fournier <ga...@gmail.com>
AuthorDate: Tue Apr 4 18:35:06 2023 +0200

    fix(e2e): Check copy to localRepository on install
---
 e2e/install/cli/install_test.go | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/e2e/install/cli/install_test.go b/e2e/install/cli/install_test.go
index f006ff2a9..bba622798 100644
--- a/e2e/install/cli/install_test.go
+++ b/e2e/install/cli/install_test.go
@@ -25,6 +25,7 @@ package cli
 import (
 	"bytes"
 	"fmt"
+	"os"
 	"reflect"
 	"strings"
 	"testing"
@@ -33,6 +34,8 @@ import (
 	. "github.com/onsi/gomega"
 	"github.com/stretchr/testify/assert"
 	corev1 "k8s.io/api/core/v1"
+	"k8s.io/client-go/kubernetes/scheme"
+	"k8s.io/client-go/tools/remotecommand"
 
 	. "github.com/apache/camel-k/v2/e2e/support"
 	v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
@@ -58,6 +61,38 @@ func TestBasicInstallation(t *testing.T) {
 			Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
 			Eventually(IntegrationConditionStatus(ns, "yaml", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
 			Eventually(IntegrationLogs(ns, "yaml"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+
+			// Check if file exists in operator pod
+			Expect(OperatorPod(ns)().Name).NotTo(Equal(""))
+			Expect(OperatorPod(ns)().Spec.Containers[0].Name).NotTo(Equal(""))
+
+			req := TestClient().CoreV1().RESTClient().Post().
+				Resource("pods").
+				Name(OperatorPod(ns)().Name).
+				Namespace(ns).
+				SubResource("exec").
+				Param("container", OperatorPod(ns)().Spec.Containers[0].Name)
+
+			req.VersionedParams(&corev1.PodExecOptions{
+				Container: OperatorPod(ns)().Spec.Containers[0].Name,
+				Command:   []string{"test", "-e", defaults.LocalRepository + "/org/apache/camel/k"},
+				Stdin:     false,
+				Stdout:    true,
+				Stderr:    true,
+				TTY:       false,
+			}, scheme.ParameterCodec)
+
+			exec, err := remotecommand.NewSPDYExecutor(TestClient().GetConfig(), "POST", req.URL())
+			Expect(err).To(BeNil())
+
+			// returns an error if file does not exists
+			execErr := exec.Stream(remotecommand.StreamOptions{
+				Stdout: os.Stdout,
+				Stderr: os.Stderr,
+				Tty:    false,
+			})
+			Expect(execErr).To(BeNil())
+
 		})
 
 		Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())


[camel-k] 01/02: fix(core): Fix copy local dependencies error message

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 350c5fb1f80aeba11921ee1dbf0ec9558db98338
Author: Gaelle Fournier <ga...@gmail.com>
AuthorDate: Tue Apr 4 17:46:29 2023 +0200

    fix(core): Fix copy local dependencies error message
    
    Change copy option to avoid trying to change the permissions on the target folder
    
    Closes #4198
---
 pkg/install/optional.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pkg/install/optional.go b/pkg/install/optional.go
index a5a1e4c6a..3dc52a945 100644
--- a/pkg/install/optional.go
+++ b/pkg/install/optional.go
@@ -30,7 +30,12 @@ import (
 // OperatorStartupOptionalTools tries to install optional tools at operator startup and warns if something goes wrong.
 func OperatorStartupOptionalTools(ctx context.Context, c client.Client, namespace string, operatorNamespace string, log logutil.Logger) {
 	// Try to copy any local runtime dependency to maven repository
-	if err := cp.Copy("/tmp/local/m2", defaults.LocalRepository); err != nil {
+
+	// Do not change the permissions on the target
+	opt := cp.Options{
+		PermissionControl: cp.DoNothing,
+	}
+	if err := cp.Copy("/tmp/local/m2", defaults.LocalRepository, opt); err != nil {
 		log.Infof("Could not copy local runtime dependencies due to %s", err.Error())
 	}