Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fgksgf committed Jan 15, 2025
1 parent 604feb0 commit c7d4d3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/utils/k8s/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ func CalculateHashAndSetLabels(pod *corev1.Pod) {

// This prevents the hash from being changed when new fields are added to the `PodSpec` due to K8s version upgrades.
buf := bytes.Buffer{}
_ = podEncoder.Encode(&corev1.Pod{Spec: *spec}, &buf)
if err := podEncoder.Encode(&corev1.Pod{Spec: *spec}, &buf); err != nil {
panic(fmt.Errorf("failed to encode pod spec, %w", err))
}
hasher := fnv.New32a()
hashutil.DeepHashObject(hasher, buf.Bytes())

Expand Down

0 comments on commit c7d4d3a

Please sign in to comment.