Skip to content

Commit

Permalink
Use the URL Override within the checker vs version, meaning the metri…
Browse files Browse the repository at this point in the history
…c labels display the override URI instead of the original, as this could cause confusion down the line
  • Loading branch information
davidcollom committed Jun 18, 2024
1 parent 0fdb1ce commit 2e765be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ func (c *Checker) Container(ctx context.Context, log *logrus.Entry,
currentTag, currentSHA)
}

if opts.OverrideURL != nil && *opts.OverrideURL != imageURL {
log.Debugf("overriding image URL %s -> %s", imageURL, *opts.OverrideURL)
imageURL = *opts.OverrideURL
}

if opts.UseSHA {
result, err := c.isLatestSHA(ctx, imageURL, statusSHA, opts)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ func (v *Version) Run(refreshRate time.Duration) {
// LatestTagFromImage will return the latest tag given an imageURL, according
// to the given options.
func (v *Version) LatestTagFromImage(ctx context.Context, imageURL string, opts *api.Options) (*api.ImageTag, error) {
if override := opts.OverrideURL; override != nil && len(*override) > 0 {
v.log.Debugf("overriding image lookup %s -> %s", imageURL, *override)
imageURL = *override
}
tagsI, err := v.imageCache.Get(ctx, imageURL, imageURL, nil)
if err != nil {
return nil, err
Expand Down

0 comments on commit 2e765be

Please sign in to comment.