diff --git a/docs/docs/crds/sbom-report.md b/docs/docs/crds/sbom-report.md index 794d286e1..f5b7bffa3 100644 --- a/docs/docs/crds/sbom-report.md +++ b/docs/docs/crds/sbom-report.md @@ -13,8 +13,6 @@ The following listing shows a sample SbomReport associated with the Pod named `k apiVersion: aquasecurity.github.io/v1alpha1 kind: SbomReport metadata: - annotations: - trivy-operator.aquasecurity.github.io/report-ttl: 24h0m0s creationTimestamp: "2023-07-10T09:37:21Z" generation: 1 labels: diff --git a/pkg/sbomreport/builder.go b/pkg/sbomreport/builder.go index 4c5f18039..d6170a280 100644 --- a/pkg/sbomreport/builder.go +++ b/pkg/sbomreport/builder.go @@ -3,7 +3,6 @@ package sbomreport import ( "fmt" "strings" - "time" "github.com/aquasecurity/trivy-operator/pkg/apis/aquasecurity/v1alpha1" "github.com/aquasecurity/trivy-operator/pkg/kube" @@ -23,7 +22,6 @@ type ReportBuilder struct { container string hash string data v1alpha1.SbomReportData - reportTTL *time.Duration resourceLabelsToInclude []string additionalReportLabels labels.Set } @@ -54,11 +52,6 @@ func (b *ReportBuilder) Data(data v1alpha1.SbomReportData) *ReportBuilder { return b } -func (b *ReportBuilder) ReportTTL(ttl *time.Duration) *ReportBuilder { - b.reportTTL = ttl - return b -} - func (b *ReportBuilder) ResourceLabelsToInclude(resourceLabelsToInclude []string) *ReportBuilder { b.resourceLabelsToInclude = resourceLabelsToInclude return b @@ -102,11 +95,6 @@ func (b *ReportBuilder) Get() (v1alpha1.SbomReport, error) { }, Report: b.data, } - if b.reportTTL != nil { - report.Annotations = map[string]string{ - v1alpha1.TTLReportAnnotation: b.reportTTL.String(), - } - } err := kube.ObjectToObjectMeta(b.controller, &report.ObjectMeta) if err != nil { return v1alpha1.SbomReport{}, err diff --git a/pkg/vulnerabilityreport/controller/scanjob.go b/pkg/vulnerabilityreport/controller/scanjob.go index f3a007f6c..c6a7cafa5 100644 --- a/pkg/vulnerabilityreport/controller/scanjob.go +++ b/pkg/vulnerabilityreport/controller/scanjob.go @@ -256,9 +256,6 @@ func (r *ScanJobController) processScanJobResults(ctx context.Context, job *batc PodSpecHash(podSpecHash). ResourceLabelsToInclude(resourceLabelsToInclude). AdditionalReportLabels(additionalCustomLabels) - if r.Config.ScannerReportTTL != nil { - sbomReportBuilder.ReportTTL(r.Config.ScannerReportTTL) - } sbomReport, err = sbomReportBuilder.Get() if err != nil { return nil, nil, v1alpha1.SbomReport{}, err