(cmd *cobra.Command, args []string)
| 94 | } |
| 95 | |
| 96 | func (o *waitForResourceOptions) run(cmd *cobra.Command, args []string) error { |
| 97 | timeout, err := time.ParseDuration(o.timeout) |
| 98 | if err != nil { |
| 99 | return fmt.Errorf("invalid timeout duration %s, use a valid duration string e.g. 1s, 2m, 3h: %w", o.timeout, err) |
| 100 | } |
| 101 | |
| 102 | kind := args[0] |
| 103 | // identifier is optional to allow for waiting for any resource of a kind to exist in cluster. For instance, `zarf tools wait-for storageclass` |
| 104 | identifier := "" |
| 105 | if len(args) > 1 { |
| 106 | identifier = args[1] |
| 107 | } |
| 108 | |
| 109 | condition := "" |
| 110 | if len(args) > 2 { |
| 111 | condition = args[2] |
| 112 | } |
| 113 | |
| 114 | return wait.ForResourceDefaultReady(cmd.Context(), kind, identifier, condition, o.namespace, timeout) |
| 115 | } |
| 116 | |
| 117 | type waitForNetworkOptions struct { |
| 118 | timeout string |
nothing calls this directly
no test coverage detected