chore: upgrade trivy to v0.55.2 and update the logic of waiting for zot to start in some jobs (#2685)

chore: upgrade trivy to v0.55.2, also update the logic of waiting for zot to start in some jobs

Seems like there's an increate in the time zot requires to start before servicing requests.
From my GitHub observations it is better check using curl instead of relying on hardcoded 5s or 10s values.

The logic in .github/workflows/cluster.yaml seems to be old and out of date.
Even on main right now there is only 1 our of 3 zots actualy running.
The other 2 are actually erroring: Error: operation timeout: boltdb file is already in use, path '/tmp/zot/cache.db'
This is unrelated to this PR, I am seeing the same issue in the olders workflow runs still showing the logs

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
Andrei Aaron
2024-09-30 20:37:53 +03:00
committed by GitHub
parent 9cf6b0205d
commit 8553712613
7 changed files with 59 additions and 45 deletions
+5 -4
View File
@@ -46,8 +46,9 @@ func getNewScanOptions(dir string, dbRepositoryRef, javaDBRepositoryRef name.Ref
Scanners: types.Scanners{types.VulnerabilityScanner},
OfflineScan: true,
},
VulnerabilityOptions: flag.VulnerabilityOptions{
VulnType: []string{types.VulnTypeOS, types.VulnTypeLibrary},
PackageOptions: flag.PackageOptions{
PkgRelationships: fanalTypes.Relationships,
PkgTypes: []string{types.PkgTypeOS, types.PkgTypeLibrary},
},
DBOptions: flag.DBOptions{
DBRepository: dbRepositoryRef,
@@ -613,7 +614,7 @@ func (scanner Scanner) checkDBPresence() error {
result := true
if scanner.storeController.DefaultStore != nil {
dbDir := path.Join(scanner.storeController.DefaultStore.RootDir(), "_trivy")
dbDir := path.Join(scanner.storeController.DefaultStore.RootDir(), "_trivy", "db")
if _, err := os.Stat(metadata.Path(dbDir)); err != nil {
result = false
}
@@ -621,7 +622,7 @@ func (scanner Scanner) checkDBPresence() error {
if scanner.storeController.SubStore != nil {
for _, storage := range scanner.storeController.SubStore {
dbDir := path.Join(storage.RootDir(), "_trivy")
dbDir := path.Join(storage.RootDir(), "_trivy", "db")
if _, err := os.Stat(metadata.Path(dbDir)); err != nil {
result = false