aquasecurity / fanal

Static Analysis Library for Containers
Apache License 2.0
199 stars 100 forks source link

create fanal cache at top level instead of subdirectory "fanal" #422

Open shimish2 opened 2 years ago

shimish2 commented 2 years ago

Currently fanal cache being generated inside "fanal" directory.

    dir := filepath.Join(cacheDir, cacheDirName)
    if err := os.MkdirAll(dir, 0700); err != nil {
        return FSCache{}, xerrors.Errorf("failed to create cache dir: %w", err)
    }

Can we create a fanal cache at cacheDir level instead of cacheDirName

afdesk commented 2 years ago

@shimish2 why is it needed for your?

shimish2 commented 2 years ago

I am trying to integrate trivy for my oci repository server and in our oci repository storage every directory is oci layout, so when I try to integrate trivy, fanal cache is created under db directory which is not an oci layout. That's why I was looking for option if we can create db at top level.

rchincha commented 2 years ago

Just to be clear, the ask is whether the location of the fanal cache is configurable? For our application, the fanal cache path and name collides with other artifacts. Happy to post a PR if this is reasonable. Also best if this possible from code itself since our project links with the fanal go code.