File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -105,13 +105,14 @@ func (s *Service) Reconcile(ctx context.Context) error {
105105 return errors .Wrap (err , "cannot update tags" )
106106 }
107107 }
108-
109- // We also need to update the annotation if anything changed.
110- if err := s .Scope .UpdateAnnotationJSON (tagsSpec .Annotation , newAnnotation ); err != nil {
111- return err
112- }
113108 log .V (2 ).Info ("successfully updated tags" )
114109 }
110+
111+ // We also need to update the annotation even if nothing changed to
112+ // ensure it's set immediately following resource creation.
113+ if err := s .Scope .UpdateAnnotationJSON (tagsSpec .Annotation , newAnnotation ); err != nil {
114+ return err
115+ }
115116 }
116117 return nil
117118}
Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ func TestReconcileTags(t *testing.T) {
218218 },
219219 }}, nil )
220220 s .AnnotationJSON ("my-annotation" ).Return (map [string ]interface {}{"key" : "value" }, nil )
221+ s .UpdateAnnotationJSON ("my-annotation" , map [string ]interface {}{"key" : "value" })
221222 },
222223 },
223224 }
You can’t perform that action at this time.
0 commit comments