From ce80b3e7d9a60fd32d5c1b64ae9382adc780070f Mon Sep 17 00:00:00 2001 From: Ian Howell Date: Fri, 15 May 2020 14:10:06 -0500 Subject: [PATCH] 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 --- pkg/clusterctl/cmd/command.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/clusterctl/cmd/command.go b/pkg/clusterctl/cmd/command.go index 5d843f291..6c11fb4c6 100644 --- a/pkg/clusterctl/cmd/command.go +++ b/pkg/clusterctl/cmd/command.go @@ -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