(cmd *cobra.Command, args []string)
| 135 | } |
| 136 | |
| 137 | func (o *waitForNetworkOptions) run(cmd *cobra.Command, args []string) error { |
| 138 | timeout, err := time.ParseDuration(o.timeout) |
| 139 | if err != nil { |
| 140 | return fmt.Errorf("invalid timeout duration %s, use a valid duration string e.g. 1s, 2m, 3h: %w", o.timeout, err) |
| 141 | } |
| 142 | |
| 143 | protocol := args[0] |
| 144 | address := args[1] |
| 145 | |
| 146 | condition := "" |
| 147 | if len(args) > 2 { |
| 148 | condition = args[2] |
| 149 | } |
| 150 | |
| 151 | return wait.ForNetwork(cmd.Context(), protocol, address, condition, timeout) |
| 152 | } |
nothing calls this directly
no test coverage detected