What's the difference between PATCH and PUT a deployment

864 views
Skip to first unread message

lin.for...@gmail.com

unread,
Aug 5, 2016, 2:56:43 AM8/5/16
to kubernetes-dev
Hi,

Can anyone tell me what's the difference between PATCH and PUT a deployment? For example, I just want to change the "change-cause" of rollout action. PATCH the deployment would require this

{"metadata":{"annotations":{"kubernetes.io/change-cause":"Update image to apche2"}}}

Thanks

Tim Hockin

unread,
Aug 5, 2016, 3:06:30 AM8/5/16
to lin.for...@gmail.com, kubernetes-dev
PUT is a full replacement. You have to have ALL the fields present.
PATCH is partial.
> --
> You received this message because you are subscribed to the Google Groups
> "kubernetes-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kubernetes-de...@googlegroups.com.
> To post to this group, send email to kuberne...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/kubernetes-dev/b97517ca-110a-4aef-acc2-798190edcccb%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

lin.for...@gmail.com

unread,
Aug 5, 2016, 4:01:21 AM8/5/16
to kubernetes-dev, lin.for...@gmail.com
I was wondering if I use PATCH to update the "kubernetes.io/change-cause" annotation, will it be passed to related ReplicaSet in the deployment? If yes, then I can view the rollout history with updated change-cause.

Thanks.

Janet Kuo

unread,
Aug 9, 2016, 6:58:55 PM8/9/16
to Kubernetes developer/contributor discussion, lin.for...@gmail.com
Yes, if you update the deployment's change-cause annotation (in fact, all annotations except for some system-generated ones), it'll be copied to its *new* replica set (the one whose template is the same as the deployment's at that moment).
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages