Skip to content

Commit ebfeccb

Browse files
committed
feat: argocd exists function
Signed-off-by: Daniel Hu <[email protected]>
1 parent ae8cf0e commit ebfeccb

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

internal/pkg/start/start.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@ package start
22

33
import (
44
"fmt"
5+
"time"
56

67
"github.com/devstream-io/devstream/internal/pkg/start/tool"
78
)
89

910
func Start() error {
11+
fmt.Println("I'll prepare some tools for you.")
12+
time.Sleep(time.Second)
1013
fmt.Println("Let's get started.")
14+
fmt.Println()
1115

1216
err := installToolsIfNotExist()
1317
if err != nil {
1418
return err
1519
}
1620

17-
fmt.Println("Enjoy it!☺️")
21+
fmt.Println("\nEverything is going well now.\nEnjoy it!☺️")
22+
fmt.Println()
1823
return nil
1924
}
2025

@@ -30,6 +35,7 @@ func installToolsIfNotExist() error {
3035
return err
3136
}
3237
}
38+
fmt.Printf("✅ %s is ready.\n", t.Name)
3339
}
3440
return nil
3541
}

internal/pkg/start/tool/argocd.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ package tool
22

33
import (
44
"fmt"
5+
"os/exec"
56

67
"github.com/devstream-io/devstream/internal/pkg/plugin/installer/helm"
78
helmCommon "github.com/devstream-io/devstream/pkg/util/helm"
9+
helmUtil "github.com/devstream-io/devstream/pkg/util/helm"
810
"github.com/devstream-io/devstream/pkg/util/k8s"
911
"github.com/devstream-io/devstream/pkg/util/types"
10-
11-
helmUtil "github.com/devstream-io/devstream/pkg/util/helm"
1212
)
1313

1414
var toolArgocd = tool{
1515
Name: "Argo CD",
1616
IfExists: func() bool {
17-
// TODO(dh)
18-
return false
17+
cmd := exec.Command("kubectl", "get", "ns", "argocd")
18+
return cmd.Run() == nil
1919
},
2020

2121
Install: func() error {

0 commit comments

Comments
 (0)