mirror of
https://github.com/stakater/Reloader.git
synced 2026-05-17 06:06:39 +00:00
Refactor code and fix leader election tests
Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
This commit is contained in:
@@ -26,9 +26,14 @@ func TestGetImageRepository(t *testing.T) {
|
||||
expected: "ghcr.io/stakater/reloader",
|
||||
},
|
||||
{
|
||||
name: "image with digest (not fully supported)",
|
||||
name: "image with digest",
|
||||
image: "nginx@sha256:abc123",
|
||||
expected: "nginx@sha256",
|
||||
expected: "nginx",
|
||||
},
|
||||
{
|
||||
name: "full image with digest",
|
||||
image: "ghcr.io/stakater/reloader@sha256:deadbeef",
|
||||
expected: "ghcr.io/stakater/reloader",
|
||||
},
|
||||
{
|
||||
name: "simple image name",
|
||||
@@ -88,6 +93,16 @@ func TestGetImageTag(t *testing.T) {
|
||||
image: "myimage:sha-abc123",
|
||||
expected: "sha-abc123",
|
||||
},
|
||||
{
|
||||
name: "image with digest",
|
||||
image: "nginx@sha256:abc123",
|
||||
expected: "sha256:abc123",
|
||||
},
|
||||
{
|
||||
name: "full image with digest",
|
||||
image: "ghcr.io/stakater/reloader@sha256:deadbeef",
|
||||
expected: "sha256:deadbeef",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user