Skip to content

Commit

Permalink
Early return.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed May 2, 2024
1 parent b980e36 commit 176db9e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controllers/deployment/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,18 @@ func (c *controller) osImageHasChanged(r *controllers.Ctx[*v2.FirewallDeployment
}

// let's resolve the latest image from the api in case a shorthand image flag is being used
// then compare to the actual image deployed on the firewalls in this set

image, err := c.imageCache.Get(r.Ctx, newS.Image)
if err != nil {
return false, err
}

if pointer.SafeDeref(image.ID) == newS.Image {
// early return because no shorthand image used
return false, err
}

// now compare to the actual image deployed on the firewalls in this set

ownedFirewalls, _, err := controllers.GetOwnedResources(r.Ctx, c.c.GetSeedClient(), nil, latestSet, &v2.FirewallList{}, func(fl *v2.FirewallList) []*v2.Firewall {
return fl.GetItems()
})
Expand Down

0 comments on commit 176db9e

Please sign in to comment.