Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Implement force for kubectl command
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshVanL committed Jul 9, 2018
1 parent 68b1bf1 commit 4c70a54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions pkg/tarmak/kubectl/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 3 additions & 4 deletions pkg/tarmak/tarmak.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -294,7 +293,7 @@ func (t *Tarmak) Validate() error {
result = multierror.Append(result, err)
}

return result
return result.ErrorOrNil()
}

func (t *Tarmak) Cleanup() {
Expand Down

0 comments on commit 4c70a54

Please sign in to comment.