Skip to content

Commit

Permalink
chore: force vault port forward on failure (#623)
Browse files Browse the repository at this point in the history
Signed-off-by: João Vanzuita <joao@kubeshop.io>

Signed-off-by: João Vanzuita <joao@kubeshop.io>
  • Loading branch information
João Paulo Vanzuita authored Oct 26, 2022
1 parent 376606f commit 35f515e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 8 additions & 0 deletions cmd/createUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ func loopUntilPodIsReady(dryRun bool) {
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Println("error with http request Do, vault is not available", err)
// todo: temporary code
log.Println("trying to open port-forward again...")
go func() {
_, err := k8s.PortForward(false, "vault", "svc/vault", "8200:8200")
if err != nil {
log.Println("error opening Vault port forward")
}
}()
continue
}

Expand Down
2 changes: 0 additions & 2 deletions cmd/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ var localCmd = &cobra.Command{
RunE: func(cmd *cobra.Command, args []string) error {

initFlags := initCmd.Flags()
//err := initFlags.Set("gitops-branch", "main")
err := initFlags.Set("gitops-branch", "main")
if err != nil {
return err
}
//viper.Set("gitops.branch", "main")
viper.Set("gitops.branch", "main")

err = initFlags.Set("metaphor-branch", "main")
Expand Down

0 comments on commit 35f515e

Please sign in to comment.