Skip to content

Commit afca3a8

Browse files
committed
feature: mirror of security/trivy-checks:0 image
Signed-off-by: Maxim Vasilenko <[email protected]>
1 parent 7bad692 commit afca3a8

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

internal/mirror/cmd/vulndb/pull/pull.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ func pull(_ *cobra.Command, _ []string) error {
106106
if err != nil {
107107
return fmt.Errorf("creating java db layout: %w", err)
108108
}
109+
imageLayouts.TrivyChecks, err = layouts.CreateEmptyImageLayoutAtPath(filepath.Join(VulnerabilityDBPath, "trivy-checks"))
110+
if err != nil {
111+
return fmt.Errorf("creating java db layout: %w", err)
112+
}
109113

110114
if err := layouts.PullTrivyVulnerabilityDatabasesImages(pullContext, imageLayouts); err != nil {
111115
return fmt.Errorf("pull vulnerability databases: %w", err)

internal/mirror/cmd/vulndb/push/push.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func push(_ *cobra.Command, _ []string) error {
9393
path.Join(RegistryRepo, "security", "trivy-db"): filepath.Join(VulnerabilityDBPath, "trivy-db"),
9494
path.Join(RegistryRepo, "security", "trivy-bdu"): filepath.Join(VulnerabilityDBPath, "trivy-bdu"),
9595
path.Join(RegistryRepo, "security", "trivy-java-db"): filepath.Join(VulnerabilityDBPath, "trivy-java-db"),
96+
path.Join(RegistryRepo, "security", "trivy-checks"): filepath.Join(VulnerabilityDBPath, "trivy-checks"),
9697
}
9798

9899
repoCount := 0

pkg/libmirror/layouts/layouts.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ type ImageLayouts struct {
5858
TrivyBDUImages map[string]struct{}
5959
TrivyJavaDB layout.Path
6060
TrivyJavaDBImages map[string]struct{}
61+
TrivyChecks layout.Path
62+
TrivyChecksImages map[string]struct{}
6163

6264
Modules map[string]ModuleImageLayout
6365

@@ -90,6 +92,7 @@ func CreateOCIImageLayoutsForDeckhouse(
9092
&layouts.TrivyDB: filepath.Join(rootFolder, "security", "trivy-db"),
9193
&layouts.TrivyBDU: filepath.Join(rootFolder, "security", "trivy-bdu"),
9294
&layouts.TrivyJavaDB: filepath.Join(rootFolder, "security", "trivy-java-db"),
95+
&layouts.TrivyChecks: filepath.Join(rootFolder, "security", "trivy-checks"),
9396
}
9497
for layoutPtr, fsPath := range fsPaths {
9598
*layoutPtr, err = CreateEmptyImageLayoutAtPath(fsPath)
@@ -183,6 +186,7 @@ func FillLayoutsWithBasicDeckhouseImages(
183186
mirrorCtx.DeckhouseRegistryRepo + "/security/trivy-db:2": {},
184187
mirrorCtx.DeckhouseRegistryRepo + "/security/trivy-bdu:1": {},
185188
mirrorCtx.DeckhouseRegistryRepo + "/security/trivy-java-db:1": {},
189+
mirrorCtx.DeckhouseRegistryRepo + "/security/trivy-checks:0": {},
186190
}
187191

188192
for _, version := range deckhouseVersions {

pkg/libmirror/layouts/pull.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ func PullTrivyVulnerabilityDatabasesImages(
127127
layouts.TrivyDB: path.Join(pullCtx.DeckhouseRegistryRepo, "security", "trivy-db:2"),
128128
layouts.TrivyBDU: path.Join(pullCtx.DeckhouseRegistryRepo, "security", "trivy-bdu:1"),
129129
layouts.TrivyJavaDB: path.Join(pullCtx.DeckhouseRegistryRepo, "security", "trivy-java-db:1"),
130+
layouts.TrivyChecks: path.Join(pullCtx.DeckhouseRegistryRepo, "security", "trivy-checks:0"),
130131
}
131132

132133
for dbImageLayout, imageRef := range dbImages {

pkg/libmirror/operations/push.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ func findLayoutsToPush(mirrorCtx *contexts.PushContext) (map[string]layout.Path,
103103
{"security", "trivy-db"},
104104
{"security", "trivy-bdu"},
105105
{"security", "trivy-java-db"},
106+
{"security", "trivy-checks"},
106107
}
107108

108109
for _, bundlePath := range bundlePaths {

testing/e2e/mirror/mirror_e2e_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func createTrivyVulnerabilityDatabasesInRegistry(t *testing.T, repo string, inse
122122
repo + "/security/trivy-db:2",
123123
repo + "/security/trivy-bdu:1",
124124
repo + "/security/trivy-java-db:1",
125+
repo + "/security/trivy-checks:0",
125126
}
126127

127128
for _, image := range images {

0 commit comments

Comments
 (0)