MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / hasValidPodSpec

Function hasValidPodSpec

internal/controller/cluster_upgrade.go:473–480  ·  view source on GitHub ↗

check if the pod has a valid podSpec

(pod *corev1.Pod)

Source from the content-addressed store, hash-verified

471
472// check if the pod has a valid podSpec
473func hasValidPodSpec(pod *corev1.Pod) bool {
474 podSpecAnnotation, hasStoredPodSpec := pod.Annotations[utils.PodSpecAnnotationName]
475 if !hasStoredPodSpec {
476 return false
477 }
478 err := json.Unmarshal([]byte(podSpecAnnotation), &corev1.PodSpec{})
479 return err == nil
480}
481
482func checkPodNeedsUpdatedTopology(_ context.Context, pod *corev1.Pod, cluster *apiv1.Cluster) (rollout, error) {
483 if reflect.DeepEqual(cluster.Spec.TopologySpreadConstraints, pod.Spec.TopologySpreadConstraints) {

Callers 2

isPodNeedingRolloutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected