What is oc patch and how is it different from oc replace?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

What is oc patch and how is it different from oc replace?

Explanation:
Patch is meant for changes to a live resource by sending only the modifications you want to apply. It updates specific fields while leaving the rest of the object intact, which makes it ideal for small tweaks like adjusting a replica count or adding an annotation without rebuilding the whole object. Replace, on the other hand, takes a complete object representation and writes it over the existing resource. Any fields not present in your input will be removed, so the resource ends up exactly as you provided it. In short, patch updates parts of an object; replace replaces the entire object with a new version.

Patch is meant for changes to a live resource by sending only the modifications you want to apply. It updates specific fields while leaving the rest of the object intact, which makes it ideal for small tweaks like adjusting a replica count or adding an annotation without rebuilding the whole object. Replace, on the other hand, takes a complete object representation and writes it over the existing resource. Any fields not present in your input will be removed, so the resource ends up exactly as you provided it. In short, patch updates parts of an object; replace replaces the entire object with a new version.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy