Skip to content

Commit 35f515e

Browse files
author
João Paulo Vanzuita
authored
chore: force vault port forward on failure (#623)
Signed-off-by: João Vanzuita <joao@kubeshop.io> Signed-off-by: João Vanzuita <joao@kubeshop.io>
1 parent 376606f commit 35f515e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

cmd/createUtils.go

+8
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ func loopUntilPodIsReady(dryRun bool) {
136136
res, err := http.DefaultClient.Do(req)
137137
if err != nil {
138138
log.Println("error with http request Do, vault is not available", err)
139+
// todo: temporary code
140+
log.Println("trying to open port-forward again...")
141+
go func() {
142+
_, err := k8s.PortForward(false, "vault", "svc/vault", "8200:8200")
143+
if err != nil {
144+
log.Println("error opening Vault port forward")
145+
}
146+
}()
139147
continue
140148
}
141149

cmd/local.go

-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ var localCmd = &cobra.Command{
1414
RunE: func(cmd *cobra.Command, args []string) error {
1515

1616
initFlags := initCmd.Flags()
17-
//err := initFlags.Set("gitops-branch", "main")
1817
err := initFlags.Set("gitops-branch", "main")
1918
if err != nil {
2019
return err
2120
}
22-
//viper.Set("gitops.branch", "main")
2321
viper.Set("gitops.branch", "main")
2422

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

0 commit comments

Comments
 (0)