Skip to content

Commit

Permalink
Merge pull request #82 from DataDog/corentin.chary/add-metrics
Browse files Browse the repository at this point in the history
vpa-admisssion-controller: don't panic on pod without any annotations
  • Loading branch information
iksaif authored Mar 29, 2023
2 parents da1a7c6 + 79cf791 commit 52c0e1a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ func PodFromPodTemplateSpec(objectMeta *metav1.ObjectMeta, podTemplateSpec *v1.P
}
// We also need to propagate the trigger annotation that was likely set on the parent.
if annotations.HasVpaTrigger(objectMeta) {
if pod.Annotations == nil {
pod.Annotations = make(map[string]string)
}
pod.Annotations[annotations.VpaTriggerLabel] = annotations.VpaTriggerEnabled
}
if pod.Name == "" {
Expand Down

0 comments on commit 52c0e1a

Please sign in to comment.