Skip to content

Commit

Permalink
Avoid passing pointer in iteration (#1129)
Browse files Browse the repository at this point in the history
Signed-off-by: Becky Huang <beckyhd@google.com>
  • Loading branch information
becky-hd committed Feb 12, 2021
1 parent 001f4c3 commit f27a73e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/readiness/ready_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ func (t *Tracker) collectForObjectTracker(ctx context.Context, es Expectations,
unsatisfiedmap[o] = struct{}{}
}
for _, o := range ul.Items {
o := o
k, err := objKeyFromObject(&o)
if err != nil {
return errors.Wrapf(err, "while getting key for %v in collectForObjectTracker", o)
Expand Down Expand Up @@ -351,6 +352,7 @@ func (t *Tracker) trackConstraintTemplates(ctx context.Context) error {

handled := make(map[schema.GroupVersionKind]bool, len(templates.Items))
for _, ct := range templates.Items {
ct := ct
log.V(1).Info("expecting template", "name", ct.GetName())
t.templates.Expect(&ct)

Expand Down

0 comments on commit f27a73e

Please sign in to comment.