File tree Expand file tree Collapse file tree
persysctl/internal/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ type Config struct {
1919 APIEndpoint string
2020 PrivateKey * rsa.PrivateKey
2121 PublicKeyPEM string
22-
22+ APIVersion string
23+ ClusterID string
2324 Transport string
2425 GRPCEndpoint string
2526 GRPCInsecure bool
@@ -75,6 +76,18 @@ func GetConfig() Config {
7576 log .Printf ("WARNING! No api_endpoint found in your config.yaml; defaulting to: %v" , cfg .APIEndpoint )
7677 }
7778
79+ cfg .APIVersion = viper .GetString ("api_version" )
80+ if cfg .APIVersion == "" {
81+ cfg .APIVersion = "v2"
82+ log .Printf ("WARNING! No api_version found in your config.yaml; defaulting to: %v" , cfg .APIVersion )
83+ }
84+
85+ cfg .ClusterID = viper .GetString ("cluster_id" )
86+ if cfg .ClusterID == "" {
87+ cfg .ClusterID = "persys-genesis-a"
88+ log .Printf ("WARNING! No cluster_id found in your config.yaml; some operations may fail." )
89+ }
90+
7891 cfg .Transport = strings .ToLower (viper .GetString ("transport" ))
7992 if cfg .Transport == "" {
8093 cfg .Transport = "grpc"
You can’t perform that action at this time.
0 commit comments