MCPcopy
hub / github.com/zarf-dev/zarf / run

Method run

src/cmd/wait.go:96–115  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

94}
95
96func (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
117type waitForNetworkOptions struct {
118 timeout string

Callers

nothing calls this directly

Calls 1

ForResourceDefaultReadyFunction · 0.92

Tested by

no test coverage detected