| 80 | } |
| 81 | |
| 82 | func (ws *waitValue) Set(s string) error { |
| 83 | switch s { |
| 84 | case string(kube.StatusWatcherStrategy), string(kube.LegacyStrategy), string(kube.HookOnlyStrategy): |
| 85 | *ws = waitValue(s) |
| 86 | return nil |
| 87 | case "true": |
| 88 | slog.Warn("--wait=true is deprecated (boolean value) and can be replaced with --wait=watcher") |
| 89 | *ws = waitValue(kube.StatusWatcherStrategy) |
| 90 | return nil |
| 91 | case "false": |
| 92 | slog.Warn("--wait=false is deprecated (boolean value) and can be replaced with --wait=hookOnly") |
| 93 | *ws = waitValue(kube.HookOnlyStrategy) |
| 94 | return nil |
| 95 | default: |
| 96 | return fmt.Errorf("invalid wait input %q. Valid inputs are %s, %s, and %s", s, kube.StatusWatcherStrategy, kube.HookOnlyStrategy, kube.LegacyStrategy) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func (ws *waitValue) Type() string { |
| 101 | return "WaitStrategy" |