Introduce "controller init" and generate self-signed X.509 certificate (#17)

This commit is contained in:
Nikolay Edigaryev
2023-02-04 11:40:07 +04:00
committed by GitHub
parent ab3ffe82fa
commit a7264370f5
11 changed files with 301 additions and 33 deletions
+4 -4
View File
@@ -7,7 +7,7 @@ import (
"path/filepath"
)
var dataDir string
var dataDirPath string
func NewCommand() *cobra.Command {
command := &cobra.Command{
@@ -15,15 +15,15 @@ func NewCommand() *cobra.Command {
Short: "Initialize and run a controller on the local machine",
}
command.AddCommand(newRunCommand())
command.AddCommand(newInitCommand(), newRunCommand())
orchardHome, err := orchardhome.Path()
if err != nil {
log.Fatal(err)
}
command.PersistentFlags().StringVar(&dataDir, "data-dir", filepath.Join(orchardHome, "controller"),
"path to the data directory")
command.PersistentFlags().StringVar(&dataDirPath, "data-dir", filepath.Join(orchardHome, "controller"),
"path to the data controller's directory")
return command
}