-
Notifications
You must be signed in to change notification settings - Fork 227
Object inspection support #107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM 👍
some nits
cmd/ignite/cmd/inspect.go
Outdated
} | ||
|
||
func addInspectFlags(fs *pflag.FlagSet, i *run.InspectFlags) { | ||
fs.BoolVarP(&i.YAMLOutput, "yaml", "y", false, "Output the object in YAML format instead of JSON") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't have to be done now, but eventually this should be done as --output=<type>
=> -o=yaml
, -o=json
instead for reusability and consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworked in c6622cf.
cmd/ignite/cmd/inspect.go
Outdated
"github.com/spf13/pflag" | ||
"github.com/weaveworks/ignite/cmd/ignite/run" | ||
"github.com/weaveworks/ignite/pkg/errutils" | ||
"io" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be in its own group up top
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in c6622cf.
"fmt" | ||
"github.com/weaveworks/ignite/pkg/apis/ignite/scheme" | ||
"github.com/weaveworks/ignite/pkg/client" | ||
"github.com/weaveworks/ignite/pkg/filter" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: grouping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in c6622cf.
cmd/ignite/run/inspect.go
Outdated
var kind meta.Kind | ||
io := &inspectOptions{InspectFlags: i} | ||
|
||
switch k { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings.ToLower(k)
to support ignite inspect Image foo
if somebody would do it. no need to error in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, was not sure if it's needed as it could train the user "incorrect" usage. Implemented in c6622cf now.
Run `make tidy` as well which fixes the import ordering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR adds the
ignite inspect
command to retrieve the information/configuration of an Ignite object.