Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "update {NAME|PID}", Short: "Update a process", Args: cobra.MinimumNArgs(1), Run: utilities.RunCommand(func(output *output.Output, cmd *cobra.Command, args []string) { client, err := utilities.Client() if err != nil { output.Add( "error", outputs.Fatal(err), ) return } update := newUpdateBuilder(cmd) update.includeFlag( constants.FLAG_NAME, func(config *pb.ProcessConfiguration) string { config.Name = name return "name" }, ) update.includeFlag( constants.FLAG_PERSIST, func(config *pb.ProcessConfiguration) string { config.Persist = persist return "persist" }, ) update.includeFlag( constants.FLAG_RESTART, func(config *pb.ProcessConfiguration) string { config.RestartPolicy.AutoRestart = restart return "restart_policy.auto_restart" }, ) update.includeFlag( constants.FLAG_RESTART_MAX_RETRIES, func(config *pb.ProcessConfiguration) string { config.RestartPolicy.MaxRetries = restartMaxRetries return "restart_policy.max_retries" }, ) update.includeFlag( constants.FLAG_RESTART_DELAY, func(config *pb.ProcessConfiguration) string { config.RestartPolicy.Delay = durationpb.New(restartDelay) return "restart_policy.delay" }, ) update.includeFlag( constants.FLAG_WORKING_DIRECTORY, func(config *pb.ProcessConfiguration) string { config.WorkingDirectory = workingDirectory return "working_directory" }, ) if len(update.mask) == 0 { output.Add( "error", outputs.Fatal("you must specify at least one flag for the update to be performed"), ) return } timeout, cancel := utilities.Timeout() defer cancel() reply, err := client.ProcessManager.Update( timeout, &pb.UpdateRequest{ Process: args[0], Configuration: update.config, UpdateMask: &fieldmaskpb.FieldMask{Paths: update.mask}, }, ) if out := outputs.ToError(reply, err); out != nil { output.Add("error", out) return } output.Add( "message", outputs.Process(reply.GetProcess()), ) }), }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.