package
1.8.0
Repository: https://github.com/openkruise/kruise.git
Documentation: pkg.go.dev

# Functions

code lifted from https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/core/pods/helpers.go ConvertDownwardAPIFieldLabel converts the specified downward API field label and its value in the pod of the specified version to the internal version, and returns the converted label and value.
FetchSidecarSetMatchedNamespace fetch sidecarSet matched namespaces.
GetHotUpgradeContainerName returns format: mesh-1, mesh-2.
GetPodHotUpgradeContainers return two hot upgrade sidecar containers workContainer: currently working sidecar container, record in pod annotations[kruise.io/sidecarset-working-hotupgrade-container] otherContainer: 1.
GetPodHotUpgradeInfoInAnnotations checks which hot upgrade sidecar container is working now format: sidecarset.spec.container[x].name -> pod.spec.container[x].name for example: mesh -> mesh-1, envoy -> envoy-2.
GetPodSidecarSetVersionAnnotation is only used in hot upgrade container cName format: mesh-1, mesh-2.
IsActivePod determines the pod whether need be injected and updated.
IsHotUpgradeContainer indicates whether sidecar container update strategy is HotUpdate.
whether this pod has been updated based on the latest sidecarSet.
IsSidecarContainer check whether initContainer is sidecar container in k8s 1.28.
isContainerInplaceUpdateCompleted checks whether imageID in container status has been changed since in-place update.
PatchPodMetadata patch pod annotations and labels.
PodMatchSidecarSet determines if pod match Selector of sidecar.
SidecarSetHash returns a hash of the SidecarSet.
SidecarSetHashWithoutImage calculates sidecars's container hash without its image we use this to determine if the sidecar reconcile needs to update a pod image.
UpdatePodSidecarSetHash when sidecarSet in-place update sidecar container, Update sidecarSet hash in Pod annotations[kruise.io/sidecarset-hash].

# Constants

SidecarEnvKey specifies the environment variable which record a container as injected.
SidecarSetHashAnnotation represents the key of a sidecarSet hash.
SidecarSetHashWithoutImageAnnotation represents the key of a sidecarset hash without images of sidecar.
SidecarsetInplaceUpdateStateKey records the state of inplace-update.
SidecarSetListAnnotation represent sidecarset list that injected pods.
SidecarSetUpgradable is a pod condition to indicate whether the pod's sidecarset is upgradable.
SidecarSetVersionAltEnvKey is container version env in the other sidecar container of the same hotupgrade sidecar(SIDECARSET_VERSION_ALT).
SidecarSetVersionEnvKey is sidecar container version in container env(SIDECARSET_VERSION).
SidecarSetWorkingHotUpgradeContainer records which hot upgrade container is working currently.

# Variables

SidecarIgnoredNamespaces specifies the namespaces where Pods won't get injected SidecarIgnoredNamespaces = []string{"kube-system", "kube-public"} SubPathExprEnvReg format: $(ODD_NAME)、$(POD_NAME)...

# Structs

# Interfaces