Skip to content

Commit 852f1fe

Browse files
author
OpenShift Bot
authored
Merge pull request #11220 from jim-minter/issue10462
Merged by openshift-bot
2 parents e3a2814 + 76dd1c4 commit 852f1fe

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

pkg/generate/app/cmd/describe.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ func displayName(meta kapi.ObjectMeta) string {
3030
}
3131

3232
func localOrRemoteName(meta kapi.ObjectMeta, namespace string) string {
33-
if len(meta.Namespace) == 0 || namespace == meta.Namespace {
33+
if len(meta.Namespace) == 0 {
3434
return meta.Name
3535
}
36-
return fmt.Sprintf("%q in project %q", meta.Name, meta.Namespace)
36+
return meta.Namespace + "/" + meta.Name
3737
}
3838

3939
func extractFirstImageStreamTag(newOnly bool, images ...*app.ImageRef) string {
@@ -65,9 +65,9 @@ func describeLocatedImage(refInput *app.ComponentInput, baseNamespace string) st
6565
if !image.Created.IsZero() {
6666
shortID = fmt.Sprintf("%s (%s old)", shortID, describe.FormatRelativeTime(image.Created.Time))
6767
}
68-
return fmt.Sprintf("Found image %s in image stream %s under tag %q for %q", shortID, localOrRemoteName(match.ImageStream.ObjectMeta, baseNamespace), match.ImageTag, refInput)
68+
return fmt.Sprintf("Found image %s in image stream %q under tag %q for %q", shortID, localOrRemoteName(match.ImageStream.ObjectMeta, baseNamespace), match.ImageTag, refInput)
6969
}
70-
return fmt.Sprintf("Found tag :%s in image stream %s for %q", match.ImageTag, localOrRemoteName(match.ImageStream.ObjectMeta, baseNamespace), refInput)
70+
return fmt.Sprintf("Found tag :%s in image stream %q for %q", match.ImageTag, localOrRemoteName(match.ImageStream.ObjectMeta, baseNamespace), refInput)
7171
case match.Image != nil:
7272
image := match.Image
7373
shortID := imageapi.ShortDockerImageID(image, 7)
@@ -278,10 +278,10 @@ func describeGeneratedJob(out io.Writer, ref app.ComponentReference, pod *kapi.P
278278
fmt.Fprintf(out, " * %s\n", locatedImage)
279279
}
280280

281-
fmt.Fprintf(out, " * Install will run in pod %s\n", localOrRemoteName(pod.ObjectMeta, baseNamespace))
281+
fmt.Fprintf(out, " * Install will run in pod %q\n", localOrRemoteName(pod.ObjectMeta, baseNamespace))
282282
switch {
283283
case secret != nil:
284-
fmt.Fprintf(out, " * The pod has access to your current session token through the secret %s.\n", localOrRemoteName(secret.ObjectMeta, baseNamespace))
284+
fmt.Fprintf(out, " * The pod has access to your current session token through the secret %q.\n", localOrRemoteName(secret.ObjectMeta, baseNamespace))
285285
fmt.Fprintf(out, " If you cancel the install, you should delete the secret or log out of your session.\n")
286286
case hasToken && generatorInput.Token.Env != nil:
287287
fmt.Fprintf(out, " * The pod has access to your current session token via environment variable %s.\n", *generatorInput.Token.Env)

pkg/generate/app/cmd/template.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ func TransformTemplate(tpl *templateapi.Template, client client.TemplateConfigsN
3232
// transform the template
3333
result, err := client.TemplateConfigs(namespace).Create(tpl)
3434
if err != nil {
35-
return nil, fmt.Errorf("error processing template %s: %v", name, err)
35+
return nil, fmt.Errorf("error processing template %q: %v", name, err)
3636
}
3737

3838
// ensure the template objects are decoded
3939
// TODO: in the future, this should be more automatic
4040
if errs := runtime.DecodeList(result.Objects, kapi.Codecs.UniversalDecoder()); len(errs) > 0 {
4141
err = errors.NewAggregate(errs)
42-
return nil, fmt.Errorf("error processing template %s: %v", name, err)
42+
return nil, fmt.Errorf("error processing template %q: %v", name, err)
4343
}
4444

4545
return result, nil
@@ -49,9 +49,9 @@ func TransformTemplate(tpl *templateapi.Template, client client.TemplateConfigsN
4949
func DescribeGeneratedTemplate(out io.Writer, input string, result *templateapi.Template, baseNamespace string) {
5050
qualifiedName := localOrRemoteName(result.ObjectMeta, baseNamespace)
5151
if len(input) > 0 && result.ObjectMeta.Name != input {
52-
fmt.Fprintf(out, "--> Deploying template %s for %q\n", qualifiedName, input)
52+
fmt.Fprintf(out, "--> Deploying template %q for %q to project %s\n", qualifiedName, input, baseNamespace)
5353
} else {
54-
fmt.Fprintf(out, "--> Deploying template %s\n", qualifiedName)
54+
fmt.Fprintf(out, "--> Deploying template %q to project %s\n", qualifiedName, baseNamespace)
5555
}
5656
fmt.Fprintln(out)
5757

0 commit comments

Comments
 (0)