Add EnsureComplete check to cluster init

This adds a quick sanity check to the `cluster init` command to verify
that the Config object is valid prior to running the command.

Note: This check is repeated later on when the command calls
CurrentContextTargetPath, but that check is being removed in a separate
change.

Closes: #214

Change-Id: I405dbcf2df068f7f3aa008454f92620063de9d9e
This commit is contained in:
Ian Howell 2020-05-15 14:10:06 -05:00
parent aab8325af5
commit ce80b3e7d9

View File

@ -39,6 +39,9 @@ func NewCommand(rs *environment.AirshipCTLSettings) (*Command, error) {
if err != nil {
return nil, err
}
if err = rs.Config.EnsureComplete(); err != nil {
return nil, err
}
root, err := rs.Config.CurrentContextTargetPath()
if err != nil {
return nil, err