Skip to content

Commit

Permalink
Add test for using OverrideURL in checker
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwilljones committed Aug 14, 2024
1 parent 94c8565 commit 73387e1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/controller/checker/checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,23 @@ func TestContainer(t *testing.T) {
IsLatest: true,
},
},
"if latest is latest version, and OverrideURL is set, then return true": {
statusSHA: "localhost:5000/version-checker@sha:123",
imageURL: "localhost:5000/version-checker:latest",
opts: &api.Options{
OverrideURL: stringp("quay.io/jetstack/version-checker"),
},
searchResp: &api.ImageTag{
Tag: "",
SHA: "sha:123",
},
expResult: &Result{
CurrentVersion: "sha:123",
LatestVersion: "sha:123",
ImageURL: "quay.io/jetstack/version-checker",
IsLatest: true,
},
},
"if using v0.2.0 with use sha, but not latest, return false": {
statusSHA: "localhost:5000/version-checker@sha:123",
imageURL: "localhost:5000/version-checker:v0.2.0",
Expand Down Expand Up @@ -598,3 +615,7 @@ func TestURLAndTagFromImage(t *testing.T) {
})
}
}

func stringp(s string) *string {
return &s
}

0 comments on commit 73387e1

Please sign in to comment.