This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
43 lines (37 loc) · 1.44 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"fmt"
helmwrapper "github.com/ntnguyencse/helm-mod/cmd/helm"
// "k8s.io/client-go/discovery"
// "k8s.io/client-go/tools/clientcmd"
)
func main() {
// kubePath := "/home/ubuntu/ntnguyen-helm/helm/test/kubeconfig/cluster-test"
kubePath := "/home/ubuntu/helm-mod/helm-mod/cluster-test"
fmt.Println("kubePath: ", kubePath)
chartName2 := "prometheus"
// ciliumPath := "https://github.com/ntnguyencse/helm-mod/raw/main/test/charts/cilium-1.13.0.tar.gz"
ciliumPath := "https://github.com/prometheus-community/helm-charts/releases/download/kube-prometheus-stack-48.1.1/kube-prometheus-stack-48.1.1.tgz"
ciliumHelmArgs := []string{"install", chartName2, ciliumPath, "--namespace", "cilium-system", "--kubeconfig", kubePath}
err := helmwrapper.ApplyHelmWrapper(kubePath, ciliumPath, true, false, ciliumHelmArgs, []string{})
if err != nil {
fmt.Println("error: 2", err)
}
// config, err := clientcmd.BuildConfigFromFlags("", kubePath)
// if err != nil {
// fmt.Println("Error :", err)
// // return nil, err
// }
// discoveryClient, err := discovery.NewDiscoveryClientForConfig(config)
// if err != nil {
// fmt.Println("error in discoveryClient", err)
// // return nil, err
// }
// information, err := discoveryClient.ServerVersion()
// if err != nil {
// fmt.Println("Error while fetching server version information", err)
// // return nil, err
// }
// fmt.Println("Version", information)
// // return information, err
}