kubernetes-sigs / bom

A utility to generate SPDX-compliant Bill of Materials manifests
https://kubernetes-sigs.github.io/bom/
Apache License 2.0
329 stars 48 forks source link

clean up temporary bom data #459

Open cpanato opened 1 month ago

cpanato commented 1 month ago

What type of PR is this?

/kind feature

What this PR does / why we need it:

/assign @puerco

Which issue(s) this PR fixes:

clean up temporary bom data
k8s-ci-robot commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/bom/blob/main/OWNERS)~~ [cpanato] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
puerco commented 1 month ago

/test pull-bom-check-embedded-data

puerco commented 1 month ago

I think this should fix https://github.com/kubernetes-sigs/bom/issues/458 ?

cpanato commented 1 month ago

PTAL @puerco

puerco commented 1 month ago

Taking a closer look at this PR, spdxTempDir is the directory that caches the SPDX license data. We intentionally leave that untouched after running to keep the parsed licenses cached for another run.

The stale tmp data mentioned in #458 is mostly downloaded go modules. These pile up after they are the are done being used for analysis and can take up GBs of data. This is the data stored in the directory defined here:

https://github.com/kubernetes-sigs/bom/blob/495c8d0e867b0494dabfad550579df8aee354139/pkg/spdx/gomod.go#L42