github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/cmd/chore/gen-charts/main.go (about)

     1  package main
     2  
     3  import (
     4  	"flag"
     5  	"fmt"
     6  	"os"
     7  
     8  	"github.com/caos/orbos/internal/operator/boom/templator/helm/chart/fetch"
     9  	"github.com/caos/orbos/mntr"
    10  
    11  	_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
    12  )
    13  
    14  func main() {
    15  	var basePath string
    16  	var newVersions bool
    17  
    18  	verbose := flag.Bool("verbose", false, "Print logs for debugging")
    19  	flag.BoolVar(&newVersions, "newversions", false, "Check if there are newer versions of the charts")
    20  	flag.StringVar(&basePath, "basepath", "./artifacts", "The local path where the base folder should be")
    21  	flag.Parse()
    22  
    23  	monitor := mntr.Monitor{
    24  		OnInfo:   mntr.LogMessage,
    25  		OnChange: mntr.LogMessage,
    26  		OnError:  mntr.LogError,
    27  	}
    28  	if *verbose {
    29  		monitor = monitor.Verbose()
    30  	}
    31  
    32  	// ctrl.SetLogger(monitor)
    33  
    34  	if err := fetch.All(monitor, basePath, newVersions); err != nil {
    35  		monitor.Error(fmt.Errorf("unable to fetch charts: %w", err))
    36  		os.Exit(1)
    37  	}
    38  }