OC(1)
π OC(1) β ok bestie let's cancel some builds
So you opened the manual page for oc and specifically the cancel-build command. No cap, this one's actually useful. It's from Openshift and it was ported over in June 2016 β vintage, but the vibe check still passes.
β¨ NAME β¨
oc cancel-build β the one that cancels running, pending, or new builds π«Ά
πΈ SYNOPSIS πΈ
oc cancel-build [OPTIONS]
That's it. That's the whole vibe. Just fire it off with whatever options you need π
π¦ DESCRIPTION π¦
Okay so here's the tea: this command cancels running, pending, or new builds. All three flavors, she handles them.
But listen β it's not a snap your fingers and it's gone situation. This command requests a graceful shutdown of the build. So there may be a delay between you requesting the build be cancelled and the build actually being terminated. She's polite, she's not gonna yank the plug mid-sentence π
Bestie heads up: if you're expecting instant obliteration, you're gonna have a moment of waiting. Breathe. The build is on its way out π
π OPTIONS π
--dump-logs=falseβ Specify if the build logs for the cancelled build should be shown. Default isfalse, so if you want the receipts, you gotta ask for them π₯--restart=falseβ Specify if a new build should be created after the current build is cancelled. Like a phoenix but make it CI. Defaults tofalsengl.--state=[new,pending,running]β Only cancel builds in this state. Pick fromnew,pending, orrunning. Very much a "be specific about who you're cancelling" situation π
π OPTIONS INHERITED FROM PARENT COMMANDS π
Yeah, cancel-build didn't come alone β she brought her whole friend group from the parent oc command. These are all inherited, so they work here too. Periodt.
--as=""β Username to impersonate for the operation. User could be a regular user or a service account in a namespace.--as-group=[]β Group to impersonate for the operation, this flag can be repeated to specify multiple groups. Repeat as much as you want, she doesn't mind π«Ά--as-uid=""β UID to impersonate for the operation.--as-user-extra=[]β User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key.--cache-dir="/homeless-shelter/.kube/cache"β Default cache directory β yes that's literally the path, don't come for me, I just work here π--certificate-authority=""β Path to a cert file for the certificate authority--client-certificate=""β Path to a client certificate file for TLS--client-key=""β Path to a client key file for TLS--cluster=""β The name of the kubeconfig cluster to use--context=""β The name of the kubeconfig context to use--disable-compression=falseβ If true, opt-out of response compression for all requests to the server--insecure-skip-tls-verify=falseβ If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
β οΈ ok real talk: that one literally says it makes your HTTPS connections insecure. It's giving danger. Only if you know what you're doing, bestie π
--kubeconfig=""β Path to the kubeconfig file to use for CLI requests.--kuberc=""β Path to the kuberc file to use for preferences. This can be disabled by exportingKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=off.--match-server-version=falseβ Require server version to match client version-n,--namespace=""β If present, the namespace scope for this CLI request--profile="none"β Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex) β pick your fighter π--profile-output="profile.pprof"β Name of the file to write the profile to--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 = she waits forever, main character energy honestly β-s,--server=""β The address and port of the Kubernetes API server--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--token=""β Bearer token for authentication to the API server--user=""β The name of the kubeconfig user to use--warnings-as-errors=falseβ Treat warnings received from the server as errors and exit with a non-zero exit code β she's strict, she's got boundaries π₯
π EXAMPLE π
These are the moment, honestly. Copy them exactly, no cap:
# Cancel the build with the given name
oc cancel-build ruby-build-2
# Cancel the named build and print the build logs
oc cancel-build ruby-build-2 --dump-logs
# Cancel the named build and create a new one with the same parameters
oc cancel-build ruby-build-2 --restart
# Cancel multiple builds
oc cancel-build ruby-build-1 ruby-build-2 ruby-build-3
# Cancel all builds created from the 'ruby-build' build config that are in the 'new' state
oc cancel-build bc/ruby-build --state=new
See how the last one uses bc/ruby-build? That's you being all fancy with the build config reference. Iconic π
π§ SEE ALSO π§
oc(1)β the mothership. Go say hi to her too π
β HISTORY β
June 2016, Ported from the Kubernetes man-doc generator β a genuine throwback, iykyk π
Okay that's the whole page bestie!! Big mwah to Openshift and the Openshift CLI User Manuals for this one, dated June 2016. Go forth and cancel builds responsibly, mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: openshift 4.22.0-202605222050
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms