diff --git a/pkg/tarmak/kubectl/kubectl.go b/pkg/tarmak/kubectl/kubectl.go index 9c0a920fd1..53bcd94c90 100644 --- a/pkg/tarmak/kubectl/kubectl.go +++ b/pkg/tarmak/kubectl/kubectl.go @@ -49,8 +49,10 @@ func (k *Kubectl) requestNewAdminCert(cluster *api.Cluster, authInfo *api.AuthIn k.log.Infof("request new certificate from vault (%s)", path) - if err := k.tarmak.Cluster().Environment().Validate(); err != nil { - k.log.Fatal("could not validate config: ", err) + if !k.tarmak.Config().Force() { + if err := k.tarmak.Cluster().Environment().Validate(); err != nil { + k.log.Fatal("could not validate config: ", err) + } } vault := k.tarmak.Environment().Vault() diff --git a/pkg/tarmak/tarmak.go b/pkg/tarmak/tarmak.go index 4ef1a0abb4..76056c4ba2 100644 --- a/pkg/tarmak/tarmak.go +++ b/pkg/tarmak/tarmak.go @@ -281,10 +281,9 @@ func (t *Tarmak) Version() string { } func (t *Tarmak) Validate() error { - var err error - var result error + var result *multierror.Error - err = t.Cluster().Validate() + err := t.Cluster().Validate() if err != nil { result = multierror.Append(result, err) } @@ -294,7 +293,7 @@ func (t *Tarmak) Validate() error { result = multierror.Append(result, err) } - return result + return result.ErrorOrNil() } func (t *Tarmak) Verify() error {