podpatcher

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualImages

func EqualImages(a, b *corev1.Pod) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL