OC-APPLY-EDIT-LAST-APPLIED(1)

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

✨ NAME ✨

okay so bestie, welcome to the OC APPLY(1) manual page β€” this command is oc apply edit-last-applied, and its whole job is: Edit latest last-applied-configuration annotations of a resource/object. πŸ’…

🌸 SYNOPSIS 🌸

oc apply edit-last-applied [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so edit-last-applied is literally the glow-up editor for the latest last-applied-configuration annotations of resources, and it opens them in your default editor. ✨

The edit-last-applied command lets you directly edit any API resource you can retrieve via the command-line tools. It opens the editor defined by your KUBE_EDITOR or EDITOR environment variables, or falls back to vi for Linux or notepad for Windows. You can edit multiple objects, but no cap: changes are applied one at a time. The command accepts file names as well as command-line arguments, although the files you point to must be previously saved versions of resources. 🫢

The default format is YAML. To edit in JSON, specify -o json. πŸŽ€

The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used. 🌈

🚨 in the event an error occurs while updating, a temporary file will be created on disk that contains your unapplied changes. The most common error when updating a resource is another editor changing the resource on the server. When this occurs, you will have to apply your changes to the newer version of the resource, or update your temporary saved copy to include the latest resource version. no cap, do not ignore this bestie 😭

πŸ‘‘ OPTIONS πŸ‘‘

these are the flags, one bullet each, no skipping fr fr:

  • --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. πŸ’–
  • --field-manager="kubectl-client-side-apply" β€” name of the manager used to track field ownership. πŸ‘‘
  • -f, --filename=[] β€” filename, directory, or URL to files to use to edit the resource. πŸŽ€
  • -k, --kustomize="" β€” process the kustomization directory. This flag can't be used together with -f or -R. ⚠️
  • -o, --output="" β€” output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). ✨
  • -R, --recursive=false β€” process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. πŸŒ€
  • --show-managed-fields=false β€” if true, keep the managedFields when printing objects in JSON or YAML format. 🫢
  • --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⟩). 🌸
  • --validate="ignore" β€” must be one of: strict (or true), warn, ignore (or false). "true" or "strict" will use a schema to validate the input and fail the request if invalid. It will perform server side validation if ServerSideFieldValidation is enabled on the api-server, but will fall back to less reliable client-side validation if not. "warn" will warn about unknown or duplicate fields without blocking the request if server-side field validation is enabled on the API server, and behave as "ignore" otherwise. "false" or "ignore" will not perform any schema validation, silently dropping any unknown or duplicate fields. πŸ’€
  • --windows-line-endings=false β€” defaults to the line ending native to your platform. πŸͺŸ

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

these came from the parent command like hand-me-downs but make it kubeconfig:

  • --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. πŸ‘―
  • --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. πŸ—‚οΈ
  • --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. 🚨
  • --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 exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=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). πŸ“ˆ
  • --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. ⏳
  • -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. ⚠️

🌈 EXAMPLE 🌈

okay examples, because seeing it is believing:

# Edit the last-applied-configuration annotations by type/name in YAML
oc apply edit-last-applied deployment/nginx

# Edit the last-applied-configuration annotations by file in JSON
oc apply edit-last-applied -f deploy.yaml -o json

πŸŽ€ SEE ALSO πŸŽ€

the one and only see-also bestie: oc-apply(1), πŸ’–

⭐ HISTORY ⭐

June 2016 β€” Ported from the Kubernetes man-doc generator. iconic origin story, honestly. πŸ’…

🌸 that's the whole page, bestie β€” brought to you by Openshift / Openshift CLI User Manuals, page OC APPLY(1), dated June 2016. periodt, stay slaying πŸ’–
πŸ“¦ where this page comes from