Skip to content

Commit f048786

Browse files
committed
Require read-only runtime cache delegates
1 parent 27eec14 commit f048786

3 files changed

Lines changed: 8 additions & 25 deletions

File tree

.github/workflows/spell-check.yaml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@
22
name: Spell Checking
33

44
on:
5-
pull_request_target:
5+
pull_request:
66
types: [opened, reopened, synchronize]
77

88
jobs:
99
spelling:
1010
name: Run spell check
1111
permissions:
1212
contents: read
13-
pull-requests: read
14-
actions: read
15-
outputs:
16-
followup: ${{ steps.spelling.outputs.followup }}
1713
runs-on: ubuntu-latest
18-
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
1914
concurrency:
2015
group: spelling-${{ github.event.pull_request.number || github.ref }}
2116
# note: If you use only_check_changed_files, you do not want cancel-in-progress
@@ -40,22 +35,3 @@ jobs:
4035
cspell:software-terms/src/software-tools.txt
4136
cspell:companies/src/companies.txt
4237
mondoo:mondoo_dictionary.txt
43-
44-
comment:
45-
name: Report
46-
runs-on: ubuntu-latest
47-
needs: spelling
48-
permissions:
49-
actions: read
50-
contents: read
51-
pull-requests: write
52-
if: (success() || failure()) && needs.spelling.outputs.followup
53-
steps:
54-
- name: comment
55-
uses: check-spelling/check-spelling@cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c # v0.0.26
56-
env:
57-
INPUT_IGNORE_SECURITY_ADVISORY: Sorry. https://github.com/jsoref/2026-06-16-credential-leak/blob/main/README.md
58-
with:
59-
checkout: true
60-
ignore_security_advisory: Sorry. https://github.com/jsoref/2026-06-16-credential-leak/blob/main/README.md
61-
task: ${{ needs.spelling.outputs.followup }}

controllers/container_image/runtime_cache/resources.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ func Validate(cache v1alpha2.RuntimeCacheScanner) error {
442442
if !strings.HasPrefix(delegate.HostPath, "/") {
443443
return fmt.Errorf("containers.runtimeCache.delegates[%s].hostPath must be absolute", delegate.Name)
444444
}
445+
if delegate.ReadOnly != nil && !*delegate.ReadOnly {
446+
return fmt.Errorf("containers.runtimeCache.delegates[%s].readOnly must be true", delegate.Name)
447+
}
445448
}
446449
return nil
447450
}

controllers/container_image/runtime_cache/resources_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ func TestValidateRuntimeCache(t *testing.T) {
6060
cfg.Delegates[0].HostPath = "relative.sock"
6161
assert.ErrorContains(t, Validate(cfg), "hostPath must be absolute")
6262

63+
cfg = runtimeCacheAuditConfig().Spec.Containers.RuntimeCache
64+
cfg.Delegates[0].ReadOnly = ptr.To(false)
65+
assert.ErrorContains(t, Validate(cfg), "readOnly must be true")
66+
6367
cfg = runtimeCacheAuditConfig().Spec.Containers.RuntimeCache
6468
cfg.Delegates[0].Name = strings.Repeat("a", 64)
6569
assert.ErrorContains(t, Validate(cfg), "must be a valid DNS label")

0 commit comments

Comments
 (0)