diff --git a/pkg/utils/kubelessutil.go b/pkg/utils/kubelessutil.go index 8014f1e5c..dbaf2e64e 100644 --- a/pkg/utils/kubelessutil.go +++ b/pkg/utils/kubelessutil.go @@ -80,7 +80,7 @@ func getProvisionContainer(function, checksum, fileName, handler, contentType, r originFile = decodedFile } else if strings.Contains(contentType, "url") { fromURLFile := "/tmp/func.fromurl" - prepareCommand = appendToCommand(prepareCommand, fmt.Sprintf("curl %s -L --silent --output %s", function, fromURLFile)) + prepareCommand = appendToCommand(prepareCommand, fmt.Sprintf("curl '%s' -L --silent --output %s", function, fromURLFile)) originFile = fromURLFile } else if strings.Contains(contentType, "text") || contentType == "" { // Assumming that function is plain text diff --git a/pkg/utils/kubelessutil_test.go b/pkg/utils/kubelessutil_test.go index 4e0ed53eb..44ccaacde 100644 --- a/pkg/utils/kubelessutil_test.go +++ b/pkg/utils/kubelessutil_test.go @@ -921,7 +921,7 @@ func TestGetProvisionContainer(t *testing.T) { if err != nil { t.Errorf("Unexpected error: %s", err) } - if !strings.HasPrefix(c.Args[0], "curl https://raw.githubusercontent.com/test/test/test/test.py -L --silent --output /tmp/func.fromurl") { + if !strings.HasPrefix(c.Args[0], "curl 'https://raw.githubusercontent.com/test/test/test/test.py' -L --silent --output /tmp/func.fromurl") { t.Errorf("Unexpected command: %s", c.Args[0]) } @@ -930,7 +930,7 @@ func TestGetProvisionContainer(t *testing.T) { if err != nil { t.Errorf("Unexpected error: %s", err) } - if !strings.HasPrefix(c.Args[0], "curl https://raw.githubusercontent.com/test/test/test/test.py -L --silent --output /tmp/func.fromurl") { + if !strings.HasPrefix(c.Args[0], "curl 'https://raw.githubusercontent.com/test/test/test/test.py' -L --silent --output /tmp/func.fromurl") { t.Errorf("Unexpected command: %s", c.Args[0]) } }