fix: use space prefix for deploy output text (#1144)

* chore: use space prefix for deploy output text

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/1138

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: adjust e2e deploy test expectations

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: another e2e test tweak

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: another e2e test tweak

Signed-off-by: Lance Ball <lball@redhat.com>
This commit is contained in:
Lance Ball 2022-08-02 09:11:16 -04:00 committed by GitHub
parent fd8f1803fc
commit 3b8c24092b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -699,13 +699,13 @@ func (c *Client) Deploy(ctx context.Context, path string) (err error) {
}
// Deploy a new or Update the previously-deployed function
c.progressListener.Increment("Deploying function to the cluster")
c.progressListener.Increment("⬆️ Deploying function to the cluster")
result, err := c.deployer.Deploy(ctx, f)
if result.Status == Deployed {
c.progressListener.Increment(fmt.Sprintf("Function deployed in namespace %q and exposed at URL: \n%v", result.Namespace, result.URL))
c.progressListener.Increment(fmt.Sprintf("Function deployed in namespace %q and exposed at URL: \n %v", result.Namespace, result.URL))
} else if result.Status == Updated {
c.progressListener.Increment(fmt.Sprintf("Function updated in namespace %q and exposed at URL: \n%v", result.Namespace, result.URL))
c.progressListener.Increment(fmt.Sprintf("Function updated in namespace %q and exposed at URL: \n %v", result.Namespace, result.URL))
}
return err

View File

@ -27,17 +27,17 @@ func Deploy(t *testing.T, knFunc *TestShellCmdRunner, project *FunctionTestProje
// "Function [deployed|updated] at URL: http://nodefunc.default.192.168.39.188.nip.io"
// Here we extract the URL and store on project setting so that can be used later
// to validate actual function responsiveness.
wasDeployed := regexp.MustCompile("Function [a-z]* in namespace .* at URL: \nhttp.*").MatchString(cleanStdout)
wasDeployed := regexp.MustCompile("Function [a-z]* in namespace .* at URL: \n http.*").MatchString(cleanStdout)
if !wasDeployed {
t.Fatal("Function was not deployed")
}
urlMatch := regexp.MustCompile("(URL: \nhttp.*)").FindString(cleanStdout)
urlMatch := regexp.MustCompile("(URL: \n http.*)").FindString(cleanStdout)
if urlMatch == "" {
t.Fatal("URL not returned on output")
}
project.FunctionURL = strings.Split(urlMatch, "\n")[1]
project.FunctionURL = strings.TrimSpace(strings.Split(urlMatch, "\n")[1])
project.IsDeployed = true
}