OC(1)

πŸ“¦
version 4.22.0 Β· 2 versions
, in nixpkgs unstable

✨ NAME ✨

hey bestie, welcome to the OC(1) page β€” this is oc wait, and it's literally the "wait for a specific condition on one or many resources" command. no cap, that's the whole vibe. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

oc wait [OPTIONS]

πŸ’– DESCRIPTION πŸ’–

okay so picture this: you've got a bunch of resources and you're just waiting for something specific to happen. that's the whole gig. oc wait takes multiple resources and waits until the specified condition is seen in the Status field of every single one. every. single. one. periodt. πŸ‘‘

alternatively β€” and this is lowkey iconic β€” the command can wait for the given set of resources to be created or deleted by providing the "create" or "delete" keyword as the value to the --for flag. slay.

when the condition is met, a successful message will be printed to stdout indicating exactly when the specified condition was met. and if you want to change where that goes, you can use the -o option to change the output destination. main character energy tbqh. ✨


πŸ¦‹ OPTIONS πŸ¦‹

okay bestie, here's the full menu β€” every flag, every default, nothing skipped, iykyk.
  • --all=false β€” select all resources in the namespace of the specified resource types. all of 'em. 🌈
  • -A, --all-namespaces=false β€” if present, list the requested object(s) across all namespaces. the namespace in current context is ignored even if you specified it with --namespace. it's giving "no faves" energy. πŸ’€
  • --allow-missing-template-keys=true β€” if true, ignore any errors in templates when a field or map key is missing in the template. only applies to golang and jsonpath output formats. (so don't come for me when it ignores missing keys, that's literally the point.) 🫢
  • --field-selector="" β€” selector (field query) to filter on, supports '=', '==', and '!=' (e.g. --field-selector key1=value1,key2=value2). heads up tho: the server only supports a limited number of field queries per type. πŸ™ˆ
  • -f, --filename=[] β€” identifying the resource. that's the whole description bestie, take it or leave it. πŸŽ€
  • --for="" β€” the condition to wait on: [create|delete|condition=condition-name[=condition-value]|jsonpath='{JSONPath expression}'=[JSONPath value]]. the default condition-value is true. condition values are compared after Unicode simple case folding, which is a more general form of case-insensitivity. lowkey fancy fr fr. πŸ”₯
  • --local=false β€” if true, annotation will NOT contact api-server but run locally. it's giving introvert. πŸ’…
  • -o, --output="" β€” output format. one of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). pick your fighter. ✨
  • -R, --recursive=true β€” process the directory used in -f, --filename recursively. useful when you want to manage related manifests organized within the same directory. it's giving "organized queen". πŸ‘‘
  • -l, --selector="" β€” selector (label query) to filter on, supports '=', '==', and '!=' (e.g. -l key1=value1,key2=value2). bestie, use it to filter, it's right there. 🌸
  • --show-managed-fields=false β€” if true, keep the managedFields when printing objects in JSON or YAML format. that's it. that's the flag. πŸŽ€
  • --template="" β€” template string or path to template file to use when -o=go-template, -o=go-template-file. the template format is golang templates [⟨http://golang.org/pkg/text/template/#pkg-overview⟩]. go off king. πŸ¦‹
  • --timeout=0 β€” the length of time to wait before giving up. zero means check once and don't wait, negative means wait for a week. so if you're feeling dramatic, go negative. 😭

πŸ’œ OPTIONS INHERITED FROM PARENT COMMANDS πŸ’œ

these are the flags you didn't ask for but got anyway β€” inherited from the parent command. they're still iconic, just not your faves. πŸ’…
  • --as="" β€” username to impersonate for the operation. user could be a regular user or a service account in a namespace. it's giving identity crisis but make it authorized. πŸ‘‘
  • --as-group=[] β€” group to impersonate for the operation. this flag can be repeated to specify multiple groups. collect 'em all. πŸŽ€
  • --as-uid="" β€” UID to impersonate for the operation. yes bestie, UID, not username. stay woke. ✨
  • --as-user-extra=[] β€” user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key. stacking them like a true collector. πŸ¦‹
  • --cache-dir="/homeless-shelter/.kube/cache" β€” default cache directory. the path is literally /homeless-shelter/.kube/cache and yes that's a mood. 😭
  • --certificate-authority="" β€” path to a cert file for the certificate authority. secure the bag. πŸ”₯
  • --client-certificate="" β€” path to a client certificate file for TLS. mutual auth energy. 🫢
  • --client-key="" β€” path to a client key file for TLS. keep it secret, keep it safe. πŸ’–
  • --cluster="" β€” the name of the kubeconfig cluster to use. pick your cluster bestie. 🌈
  • --context="" β€” the name of the kubeconfig context to use. it's giving "which universe am i in". πŸ’€
  • --disable-compression=false β€” if true, opt-out of response compression for all requests to the server. uncompressed and unbothered. ✨
  • --insecure-skip-tls-verify=false β€” if true, the server's certificate will not be checked for validity. warning: this will make your HTTPS connections insecure. so like, do it if you must, but it's not the flex you think it is. πŸ™ˆ
  • --kubeconfig="" β€” path to the kubeconfig file to use for CLI requests. where's your config at. πŸŽ€
  • --kuberc="" β€” path to the kuberc file to use for preferences. this can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off. very demure, very mindful. πŸ’…
  • --match-server-version=false β€” require server version to match client version. no version mismatches allowed, periodt. πŸ”₯
  • -n, --namespace="" β€” if present, the namespace scope for this CLI request. scope it out. πŸ¦‹
  • --profile="none" β€” name of profile to capture. one of (none|cpu|heap|goroutine|threadcreate|block|mutex). profile like a pro. πŸ‘‘
  • --profile-output="profile.pprof" β€” name of the file to write the profile to. it defaults to profile.pprof, which is giving "main character file name". ✨
  • --request-timeout="0" β€” the length of time to wait before giving up on a single server request. non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). a value of zero means don't timeout requests. zero = no timeout, live your life. 🌈
  • -s, --server="" β€” the address and port of the Kubernetes API server. where the magic happens. 🌸
  • --tls-server-name="" β€” server name to use for server certificate validation. if it is not provided, the hostname used to contact the server is used. default behavior but make it fashion. πŸ’–
  • --token="" β€” bearer token for authentication to the API server. it's giving VIP pass. πŸŽ€
  • --user="" β€” the name of the kubeconfig user to use. who dis. πŸ’…
  • --warnings-as-errors=false β€” treat warnings received from the server as errors and exit with a non-zero exit code. bestie, warnings go in the bin and you're leaving with a non-zero status. 🫢

🌸 EXAMPLE 🌸

okay here are the actual examples, copied exactly, no cap. use them, love them.
# Wait for the pod "busybox1" to contain the status condition of type "Ready"
oc wait --for=condition=Ready pod/busybox1

# The default value of status condition is true; you can wait for other targets after an equal delimiter (compared after Unicode simple case folding, which is a more general form of case-insensitivity)
oc wait --for=condition=Ready=false pod/busybox1

# Wait for the pod "busybox1" to contain the status phase to be "Running"
oc wait --for=jsonpath='{.status.phase}'=Running pod/busybox1

# Wait for pod "busybox1" to be Ready
oc wait --for='jsonpath={.status.conditions[?(@.type=="Ready")].status}=True' pod/busybox1

# Wait for the service "loadbalancer" to have ingress
oc wait --for=jsonpath='{.status.loadBalancer.ingress}' service/loadbalancer

# Wait for the secret "busybox1" to be created, with a timeout of 30s
oc create secret generic busybox1
oc wait --for=create secret/busybox1 --timeout=30s

# Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command
oc delete pod/busybox1
oc wait --for=delete pod/busybox1 --timeout=60s

πŸŽ€ SEE ALSO πŸŽ€


πŸ’– HISTORY πŸ’–

  • June 2016 β€” ported from the Kubernetes man-doc generator. it's giving "legacy but still slaying". ✨

okay bestie, that's the whole page. now go wait on those resources like the main character you are. πŸ’…βœ¨

opΓ©nshift β€” openshift CLI user manuals β€” OC(1) β€” june 2016 πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from