diff --git a/pkg/generate/app/cmd/describe.go b/pkg/generate/app/cmd/describe.go index e796dfb6dd94..371555295796 100644 --- a/pkg/generate/app/cmd/describe.go +++ b/pkg/generate/app/cmd/describe.go @@ -30,10 +30,10 @@ func displayName(meta kapi.ObjectMeta) string { } func localOrRemoteName(meta kapi.ObjectMeta, namespace string) string { - if len(meta.Namespace) == 0 || namespace == meta.Namespace { + if len(meta.Namespace) == 0 { return meta.Name } - return fmt.Sprintf("%q in project %q", meta.Name, meta.Namespace) + return meta.Namespace + "/" + meta.Name } func extractFirstImageStreamTag(newOnly bool, images ...*app.ImageRef) string { @@ -65,9 +65,9 @@ func describeLocatedImage(refInput *app.ComponentInput, baseNamespace string) st if !image.Created.IsZero() { shortID = fmt.Sprintf("%s (%s old)", shortID, describe.FormatRelativeTime(image.Created.Time)) } - return fmt.Sprintf("Found image %s in image stream %s under tag %q for %q", shortID, localOrRemoteName(match.ImageStream.ObjectMeta, baseNamespace), match.ImageTag, refInput) + return fmt.Sprintf("Found image %s in image stream %q under tag %q for %q", shortID, localOrRemoteName(match.ImageStream.ObjectMeta, baseNamespace), match.ImageTag, refInput) } - return fmt.Sprintf("Found tag :%s in image stream %s for %q", match.ImageTag, localOrRemoteName(match.ImageStream.ObjectMeta, baseNamespace), refInput) + return fmt.Sprintf("Found tag :%s in image stream %q for %q", match.ImageTag, localOrRemoteName(match.ImageStream.ObjectMeta, baseNamespace), refInput) case match.Image != nil: image := match.Image shortID := imageapi.ShortDockerImageID(image, 7) @@ -278,10 +278,10 @@ func describeGeneratedJob(out io.Writer, ref app.ComponentReference, pod *kapi.P fmt.Fprintf(out, " * %s\n", locatedImage) } - fmt.Fprintf(out, " * Install will run in pod %s\n", localOrRemoteName(pod.ObjectMeta, baseNamespace)) + fmt.Fprintf(out, " * Install will run in pod %q\n", localOrRemoteName(pod.ObjectMeta, baseNamespace)) switch { case secret != nil: - fmt.Fprintf(out, " * The pod has access to your current session token through the secret %s.\n", localOrRemoteName(secret.ObjectMeta, baseNamespace)) + fmt.Fprintf(out, " * The pod has access to your current session token through the secret %q.\n", localOrRemoteName(secret.ObjectMeta, baseNamespace)) fmt.Fprintf(out, " If you cancel the install, you should delete the secret or log out of your session.\n") case hasToken && generatorInput.Token.Env != nil: fmt.Fprintf(out, " * The pod has access to your current session token via environment variable %s.\n", *generatorInput.Token.Env) diff --git a/pkg/generate/app/cmd/template.go b/pkg/generate/app/cmd/template.go index 04352e49ffba..9258ea244a6b 100644 --- a/pkg/generate/app/cmd/template.go +++ b/pkg/generate/app/cmd/template.go @@ -32,14 +32,14 @@ func TransformTemplate(tpl *templateapi.Template, client client.TemplateConfigsN // transform the template result, err := client.TemplateConfigs(namespace).Create(tpl) if err != nil { - return nil, fmt.Errorf("error processing template %s: %v", name, err) + return nil, fmt.Errorf("error processing template %q: %v", name, err) } // ensure the template objects are decoded // TODO: in the future, this should be more automatic if errs := runtime.DecodeList(result.Objects, kapi.Codecs.UniversalDecoder()); len(errs) > 0 { err = errors.NewAggregate(errs) - return nil, fmt.Errorf("error processing template %s: %v", name, err) + return nil, fmt.Errorf("error processing template %q: %v", name, err) } return result, nil @@ -49,9 +49,9 @@ func TransformTemplate(tpl *templateapi.Template, client client.TemplateConfigsN func DescribeGeneratedTemplate(out io.Writer, input string, result *templateapi.Template, baseNamespace string) { qualifiedName := localOrRemoteName(result.ObjectMeta, baseNamespace) if len(input) > 0 && result.ObjectMeta.Name != input { - fmt.Fprintf(out, "--> Deploying template %s for %q\n", qualifiedName, input) + fmt.Fprintf(out, "--> Deploying template %q for %q to project %s\n", qualifiedName, input, baseNamespace) } else { - fmt.Fprintf(out, "--> Deploying template %s\n", qualifiedName) + fmt.Fprintf(out, "--> Deploying template %q to project %s\n", qualifiedName, baseNamespace) } fmt.Fprintln(out)