Skip to content

Commit 20fcdf3

Browse files
committed
update PA annotations
1 parent 5f5f6d8 commit 20fcdf3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/reconciler/revision/reconcile_resources.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,14 @@ func (c *Reconciler) reconcilePA(ctx context.Context, rev *v1.Revision) error {
173173
// We no longer require immutability, so need to reconcile PA each time.
174174
tmpl := resources.MakePA(rev, deployment)
175175
logger.Debugf("Desired PASpec: %#v", tmpl.Spec)
176-
if !equality.Semantic.DeepEqual(tmpl.Spec, pa.Spec) {
177-
diff, _ := kmp.SafeDiff(tmpl.Spec, pa.Spec) // Can't realistically fail on PASpec.
178-
logger.Infof("PA %s needs reconciliation, diff(-want,+got):\n%s", pa.Name, diff)
176+
if !equality.Semantic.DeepEqual(tmpl.Spec, pa.Spec) || !equality.Semantic.DeepEqual(tmpl.Annotations, pa.Annotations) {
177+
diffSpec, _ := kmp.SafeDiff(tmpl.Spec, pa.Spec) // Can't realistically fail on PASpec.
178+
diffAnnotations, _ := kmp.SafeDiff(tmpl.Annotations, pa.Annotations)
179+
logger.Infof("PA %s needs reconciliation, diff(-want,+got):\n%s\n%s", pa.Name, diffAnnotations, diffSpec)
179180

180181
want := pa.DeepCopy()
181182
want.Spec = tmpl.Spec
183+
want.Annotations = tmpl.Annotations
182184
if pa, err = c.client.AutoscalingV1alpha1().PodAutoscalers(ns).Update(ctx, want, metav1.UpdateOptions{}); err != nil {
183185
return fmt.Errorf("failed to update PA %q: %w", paName, err)
184186
}

0 commit comments

Comments
 (0)