Skip to content

Commit

Permalink
fix: remove sbom ttl (#1358)
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <hen.keinan@gmail.com>
  • Loading branch information
chen-keinan authored Jul 11, 2023
1 parent 4c83f8e commit 78928ce
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions docs/docs/crds/sbom-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 0 additions & 12 deletions pkg/sbomreport/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -23,7 +22,6 @@ type ReportBuilder struct {
container string
hash string
data v1alpha1.SbomReportData
reportTTL *time.Duration
resourceLabelsToInclude []string
additionalReportLabels labels.Set
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions pkg/vulnerabilityreport/controller/scanjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 78928ce

Please sign in to comment.