Skip to content

Commit

Permalink
fix: remove the scan exports volume
Browse files Browse the repository at this point in the history
1. Change the Export CVE temporary file directory to /tmp.
2. Remove the scan data export volume in Dockerfile and docker-compose
   yaml.

Fixes: goharbor#18067

Signed-off-by: chlins <chenyuzh@vmware.com>
  • Loading branch information
chlins committed Jan 17, 2023
1 parent 1297af6 commit 0e26e17
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion make/photon/jobservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions make/photon/prepare/utils/jobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
15 changes: 8 additions & 7 deletions src/pkg/scan/export/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ const (
ProjectIDsAttribute = "project_ids"
JobNameAttribute = "job_name"
UserNameAttribute = "user_name"
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")
)

0 comments on commit 0e26e17

Please sign in to comment.