(cmd *cobra.Command, args []string)
| 92 | } |
| 93 | |
| 94 | func updateAction(cmd *cobra.Command, args []string) error { |
| 95 | globalOptions, err := helpers.ProcessRootCmdFlags(cmd) |
| 96 | if err != nil { |
| 97 | return err |
| 98 | } |
| 99 | client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), globalOptions.Namespace, globalOptions.Address) |
| 100 | if err != nil { |
| 101 | return err |
| 102 | } |
| 103 | defer cancel() |
| 104 | options, err := getUpdateOption(cmd, globalOptions) |
| 105 | if err != nil { |
| 106 | return err |
| 107 | } |
| 108 | walker := &containerwalker.ContainerWalker{ |
| 109 | Client: client, |
| 110 | OnFound: func(ctx context.Context, found containerwalker.Found) error { |
| 111 | if found.MatchCount > 1 { |
| 112 | return fmt.Errorf("multiple IDs found with provided prefix: %s", found.Req) |
| 113 | } |
| 114 | err = updateContainer(ctx, client, found.Container.ID(), options, cmd) |
| 115 | return err |
| 116 | }, |
| 117 | } |
| 118 | |
| 119 | return walker.WalkAll(ctx, args, true) |
| 120 | } |
| 121 | |
| 122 | func getUpdateOption(cmd *cobra.Command, globalOptions types.GlobalCommandOptions) (updateResourceOptions, error) { |
| 123 | var options updateResourceOptions |
nothing calls this directly
no test coverage detected
searching dependent graphs…