fix: remove the scan exports volume (#18107)

1. Change the Export CVE temporary file directory to /tmp.
2. Remove the scan data export volume in Dockerfile and docker-compose
   yaml.

Fixes: #18067

Signed-off-by: chlins <chenyuzh@vmware.com>
This commit is contained in:
Chlins Zhang 2023-01-31 17:30:47 +08:00 committed by GitHub
parent ca5fed3e2c
commit bfe4362a67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 11 deletions

View File

@ -17,7 +17,7 @@ WORKDIR /harbor/
USER harbor
VOLUME ["/var/log/jobs/", "/var/scandata_exports"]
VOLUME ["/var/log/jobs/"]
HEALTHCHECK CMD curl --fail -s http://localhost:8080/api/v1/stats || curl -sk --fail --key /etc/harbor/ssl/job_service.key --cert /etc/harbor/ssl/job_service.crt https://localhost:8443/api/v1/stats || exit 1

View File

@ -253,7 +253,6 @@ services:
- SETUID
volumes:
- {{data_volume}}/job_logs:/var/log/jobs:z
- {{data_volume}}/scandata_exports:/var/scandata_exports:z
- type: bind
source: ./common/config/jobservice/config.yml
target: /etc/jobservice/config.yml

View File

@ -18,8 +18,6 @@ def prepare_job_service(config_dict):
# Job log and exported reports are stored in data dir
job_log_dir = os.path.join('/data', "job_logs")
prepare_dir(job_log_dir, uid=DEFAULT_UID, gid=DEFAULT_GID)
job_log_dir = os.path.join('/data', "scandata_exports")
prepare_dir(job_log_dir, uid=DEFAULT_UID, gid=DEFAULT_GID)
# Render Jobservice env
render_jinja(

View File

@ -8,11 +8,12 @@ const (
JobNameAttribute = "job_name"
UserNameAttribute = "user_name"
StatusMessageAttribute = "status_message"
ScanDataExportDir = "/var/scandata_exports"
QueryPageSize = 100000
ArtifactGroupSize = 10000
DigestKey = "artifact_digest"
CreateTimestampKey = "create_ts"
Vendor = "SCAN_DATA_EXPORT"
CsvJobVendorIDKey = CsvJobVendorID("vendorId")
// the scan data is a temporary file, use /tmp directory to avoid the permission issue.
ScanDataExportDir = "/tmp"
QueryPageSize = 100000
ArtifactGroupSize = 10000
DigestKey = "artifact_digest"
CreateTimestampKey = "create_ts"
Vendor = "SCAN_DATA_EXPORT"
CsvJobVendorIDKey = CsvJobVendorID("vendorId")
)