Skip to content

Commit

Permalink
Merge pull request #11220 from jim-minter/issue10462
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Oct 19, 2016
2 parents e3a2814 + 76dd1c4 commit 852f1fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions pkg/generate/app/cmd/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions pkg/generate/app/cmd/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 852f1fe

Please sign in to comment.