Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualImages ¶
func Patch ¶
func Patch(ctx context.Context, cl client.Client, pod client.Object, patch client.Patch, opts ...client.PatchOption) error
Patch patches a Pod.
The differences to the normal client.Patch method are:
- We recreate the Pod if the patch failed to apply, as Pods generally can't be altered dynamically.
- We also recreate for image changes. Normally, these would be applied by kubelet eventually, but will cause a "restarted container" event, which many users will have alerts for. It also can't be nicely controlled by the operator. So we just have to make sure to detect any changes.
- We additionally recreate the Pod if the old one is in a terminated state. This can happen if a node shuts down even with a restartPolicy: Always.
func PodNeedsRestart ¶ added in v2.2.0
func PodNeedsRestart(pod *corev1.Pod, restartPolicy corev1.RestartPolicy) bool
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.