Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

weave report -f returns misleading error message with net-plugin v2 #3102

Open
@dtshepherd

Description

What you expected to happen?

weave report should return helpful error message when invalid format string is passed to -f option.

What happened?

weave report -f '{{ .Router.Target }}' returned an error message stating "weave container is not present. Have you launched it?". The weave container was running as a net-plugin, so the reason for the error was wrong. The error was caused by an invalid format string .Router.Target does not exist, it needed to be .Router.Targets.

How to reproduce it?

  1. Launch weave as net-plugin v2
  2. Run weave report -f '{{ .Bad.Key }}'

Anything else we need to know?

Nope

Versions:

$ weave version
weave script 2.0.1
weave 2.0.1
$ docker version
Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:23:31 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:19:04 2017
 OS/Arch:      linux/amd64
 Experimental: false
$ uname -a
Linux NUC 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Logs:

NA

Network:

NA

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions