Skip to content

Commit 82b28e8

Browse files
Use digest instead of tags in scorecard images (#6393)
* Use digest instead of tags in scorecard images The use of tags breaks disconnected environments when using mirrored images. Signed-off-by: Tony Garcia <tonyg@redhat.com> * Update internal/cmd/operator-sdk/scorecard/cmd.go Co-authored-by: Tatiana Krishtop <tkrishto@redhat.com> Signed-off-by: Tony Garcia <tonyg@redhat.com> * Fix typo in image Signed-off-by: Tony Garcia <tonyg@redhat.com> --------- Signed-off-by: Tony Garcia <tonyg@redhat.com> Co-authored-by: Tatiana Krishtop <tkrishto@redhat.com>
1 parent 3af4acb commit 82b28e8

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

internal/cmd/operator-sdk/scorecard/cmd.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,15 @@ If the argument holds an image tag, it must be present remotely.`,
9090
"Disable resource cleanup after tests are run")
9191
scorecardCmd.Flags().DurationVarP(&c.waitTime, "wait-time", "w", 30*time.Second,
9292
"seconds to wait for tests to complete. Example: 35s")
93+
// Please note that for Operator-sdk + Preflight + DCI integration in disconnected environments,
94+
// it is necessary to refer to storage-image and untar-image using their digests instead of tags.
95+
// If you need to make changes to these images, please ensure that you always use the digests.
9396
scorecardCmd.Flags().StringVarP(&c.storageImage, "storage-image", "b",
94-
"quay.io/operator-framework/scorecard-storage:latest",
97+
"quay.io/operator-framework/scorecard-storage@sha256:f7bd62664a0b91034acb977a8bb4ebb76bc98a6e8bdb943eb84c8e364828f056",
9598
"Storage image to be used by the Scorecard pod")
99+
// Use the digest of the latest scorecard-untar image
96100
scorecardCmd.Flags().StringVarP(&c.untarImage, "untar-image", "u",
97-
"quay.io/operator-framework/scorecard-untar:latest",
101+
"quay.io/operator-framework/scorecard-untar@sha256:56c88afd4f20718dcd4d4384b8ff0b790f95aa4737f89f3b105b5dfc1bdb60c3",
98102
"Untar image to be used by the Scorecard pod")
99103
scorecardCmd.Flags().StringVarP(&c.testOutput, "test-output", "t", "test-output",
100104
"Test output directory.")

internal/cmd/operator-sdk/scorecard/cmd_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ var _ = Describe("Running the scorecard command", func() {
6969
flag = cmd.Flags().Lookup("storage-image")
7070
Expect(flag).NotTo(BeNil())
7171
Expect(flag.Shorthand).To(Equal("b"))
72-
Expect(flag.DefValue).To(Equal("quay.io/operator-framework/scorecard-storage:latest"))
72+
// Use the digest of the latest scorecard-storage image
73+
Expect(flag.DefValue).To(Equal("quay.io/operator-framework/scorecard-storage@sha256:f7bd62664a0b91034acb977a8bb4ebb76bc98a6e8bdb943eb84c8e364828f056"))
7374

7475
flag = cmd.Flags().Lookup("untar-image")
7576
Expect(flag).NotTo(BeNil())
7677
Expect(flag.Shorthand).To(Equal("u"))
77-
Expect(flag.DefValue).To(Equal("quay.io/operator-framework/scorecard-untar:latest"))
78+
// Use the digest of the latest scorecard-untar image
79+
Expect(flag.DefValue).To(Equal("quay.io/operator-framework/scorecard-untar@sha256:56c88afd4f20718dcd4d4384b8ff0b790f95aa4737f89f3b105b5dfc1bdb60c3"))
7880
})
7981
})
8082

website/content/en/docs/cli/operator-sdk_scorecard.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ operator-sdk scorecard [flags]
2828
-l, --selector string label selector to determine which tests are run
2929
-s, --service-account string Service account to use for tests (default "default")
3030
-x, --skip-cleanup Disable resource cleanup after tests are run
31-
-b, --storage-image string Storage image to be used by the Scorecard pod (default "quay.io/operator-framework/scorecard-storage:latest")
31+
-b, --storage-image string Storage image to be used by the Scorecard pod (default "quay.io/operator-framework/scorecard-storage@sha256:f7bd62664a0b91034acb977a8bb4ebb76bc98a6e8bdb943eb84c8e364828f056")
3232
-t, --test-output string Test output directory. (default "test-output")
33-
-u, --untar-image string Untar image to be used by the Scorecard pod (default "quay.io/operator-framework/scorecard-untar:latest")
33+
-u, --untar-image string Untar image to be used by the Scorecard pod (default "quay.io/operator-framework/scorecard-untar@sha256:56c88afd4f20718dcd4d4384b8ff0b790f95aa4737f89f3b105b5dfc1bdb60c3")
3434
-w, --wait-time duration seconds to wait for tests to complete. Example: 35s (default 30s)
3535
```
3636

0 commit comments

Comments
 (0)