mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-29 18:00:51 +01:00
updated dependencies
This commit is contained in:
@@ -12,6 +12,7 @@ var (
|
||||
runOnMaster bool
|
||||
masterConfigPath string
|
||||
masterGrpcAddress string
|
||||
masterGrpcAuthKey string
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -22,6 +23,9 @@ func init() {
|
||||
|
||||
masterCmd.PersistentFlags().StringVarP(&masterGrpcAddress, "grpc-address", "g", "", "gRPC address of master node")
|
||||
_ = viper.BindPFlag("grpcAddress", masterCmd.PersistentFlags().Lookup("grpcAddress"))
|
||||
|
||||
masterCmd.PersistentFlags().StringVarP(&masterGrpcAuthKey, "grpc-auth-key", "a", "", "gRPC auth key of master node")
|
||||
_ = viper.BindPFlag("grpcAuthKey", masterCmd.PersistentFlags().Lookup("grpcAuthKey"))
|
||||
}
|
||||
|
||||
var masterCmd = &cobra.Command{
|
||||
@@ -47,6 +51,9 @@ which runs api and assign tasks to worker nodes`,
|
||||
viper.Set("grpc.address", masterGrpcAddress)
|
||||
viper.Set("grpc.server.address", masterGrpcAddress)
|
||||
}
|
||||
if masterGrpcAuthKey != "" {
|
||||
viper.Set("grpc.authKey", masterGrpcAuthKey)
|
||||
}
|
||||
|
||||
// app
|
||||
master := apps.NewMaster(opts...)
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
var (
|
||||
workerConfigPath string
|
||||
workerGrpcAddress string
|
||||
workerGrpcAuthKey string
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,6 +22,9 @@ func init() {
|
||||
|
||||
workerCmd.PersistentFlags().StringVarP(&workerGrpcAddress, "grpc-address", "g", "", "gRPC address of worker node")
|
||||
_ = viper.BindPFlag("grpcAddress", workerCmd.PersistentFlags().Lookup("grpcAddress"))
|
||||
|
||||
workerCmd.PersistentFlags().StringVarP(&workerGrpcAuthKey, "grpc-auth-key", "a", "", "gRPC auth key of worker node")
|
||||
_ = viper.BindPFlag("grpcAuthKey", workerCmd.PersistentFlags().Lookup("grpcAuthKey"))
|
||||
}
|
||||
|
||||
var workerCmd = &cobra.Command{
|
||||
@@ -46,6 +50,9 @@ assigned by the master node`,
|
||||
opts = append(opts, apps.WithWorkerGrpcAddress(address))
|
||||
viper.Set("grpc.address", workerGrpcAddress)
|
||||
}
|
||||
if workerGrpcAuthKey != "" {
|
||||
viper.Set("grpc.authKey", workerGrpcAuthKey)
|
||||
}
|
||||
|
||||
// app
|
||||
master := apps.NewWorker(opts...)
|
||||
|
||||
Reference in New Issue
Block a user