Skip to content

Commit 69b9a8e

Browse files
committed
feat: support dry-run
Support `dry-run` to skip signing images. Signed-off-by: Noel Georgi <[email protected]>
1 parent 2aa5eee commit 69b9a8e

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-10-20T11:04:55Z by kres 46e133d.
3+
# Generated on 2025-10-20T13:39:45Z by kres 46e133d.
44

55
concurrency:
66
group: ${{ github.head_ref || github.run_id }}
@@ -212,10 +212,3 @@ jobs:
212212
- name: unit-tests-race
213213
run: |
214214
make unit-tests-race
215-
- name: coverage
216-
uses: codecov/codecov-action@v5
217-
with:
218-
files: _out/coverage-unit-tests.txt
219-
flags: unit-tests
220-
token: ${{ secrets.CODECOV_TOKEN }}
221-
timeout-minutes: 3

.kres.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ spec:
1818
linux-arm64:
1919
GOOS: linux
2020
GOARCH: arm64
21+
---
22+
kind: service.CodeCov
23+
spec:
24+
enabled: false

cmd/image-signer/cmd/sign.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ var signOptions struct {
4242
Timeout time.Duration
4343

4444
DeviceFlow bool
45+
DryRun bool
4546
}
4647

4748
func signImages(images []string) error {
@@ -67,6 +68,20 @@ func signImages(images []string) error {
6768
continue
6869
}
6970

71+
if signOptions.DryRun {
72+
fmt.Println("Dry run enabled, skipping signing.")
73+
74+
if !signatureInfo.LegacySignature {
75+
fmt.Println("Would sign legacy signature.")
76+
}
77+
78+
if !signatureInfo.BundleSignature {
79+
fmt.Println("Would sign bundle signature.")
80+
}
81+
82+
continue
83+
}
84+
7085
if err := signer.SignImage(image, signatureInfo.LegacySignature, signatureInfo.BundleSignature, signOptions.OIDCProvider, signOptions.DeviceFlow, signOptions.Timeout); err != nil {
7186
return fmt.Errorf("failed to sign image %s: %w", image, err)
7287
}
@@ -79,6 +94,7 @@ func signImages(images []string) error {
7994

8095
func init() {
8196
signCmd.Flags().BoolVarP(&signOptions.DeviceFlow, "device-flow", "d", false, "Use device flow for authentication")
97+
signCmd.Flags().BoolVarP(&signOptions.DryRun, "dry-run", "", false, "Perform a dry run without actually signing the images")
8298
signCmd.Flags().StringVarP(&signOptions.CertificateIdentityRegexp, "certificate-identity-regexp", "i", "@siderolabs\\.com$", "The identity regular expression to use for certificate verification")
8399
signCmd.Flags().StringVarP(&signOptions.CertificateOIDCIssuer, "certificate-oidc-issuer", "o", "https://accounts.google.com", "The OIDC issuer URL to use for certificate verification")
84100
signCmd.Flags().StringVarP(&signOptions.OIDCProvider, "oidc-provider", "p", "google", "The OIDC provider to use for authentication, supported values are: google, github, microsoft, Set to empty string to use the default HTML page for selection") //nolint:lll

0 commit comments

Comments
 (0)