Add ttlSecondsAfterFinished to the vulnerabilityreports Job. #566
Replies: 1 comment
-
👋 @yuzujoe Adding TTL param to the scan job spec is a great idea as a fallback. However, IIRC this in a beta feature (TTL Controller) and is not enabled by default in all clusters / cluster versions. Therefore, Starboard Operator is managing the whole lifecycle of scan jobs in reconciliation loops that it implements. In case the underlying K8s workload is deleted while scan job is still pending we should delete the job anyway. I'll double check whether we handle such scenario in code. Meanwhile, could you share any logs of the operator that may help identifying why those jobs where not automatically deleted? Sharing minimal reproduction steps would be very helpful as well. |
Beta Was this translation helpful? Give feedback.
-
After the job created by vulnerabilityreports is finished, the job itself is still there, although the pod is finished.
This seems to me to prevent the job from starting even when the image is replaced or a new pod is created.
I think the reason for this is that I haven't added
.spec.ttlSecondsAfterFinished
, which will allow me to delete the Job after a specified time.https://github.com/aquasecurity/starboard/blob/main/pkg/vulnerabilityreport/scanner.go#L144
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions