Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkloadAnnotator ¶
type WorkloadAnnotator interface {
Annotate(ctx context.Context, ref podscanner.WorkloadRef) (annotated bool, err error)
}
WorkloadAnnotator annotates workloads to trigger restarts.
type WorkloadAnnotatorImpl ¶
type WorkloadAnnotatorImpl struct {
// contains filtered or unexported fields
}
WorkloadAnnotatorImpl adds the restartedAt annotation to workload pod templates.
func NewWorkloadAnnotator ¶
func NewWorkloadAnnotator(c client.Client, annotationCooldown time.Duration) *WorkloadAnnotatorImpl
NewWorkloadAnnotator creates a new WorkloadAnnotatorImpl. annotationCooldown: skip re-annotating if the workload was annotated within this duration; 0 disables the check.
func (*WorkloadAnnotatorImpl) Annotate ¶
func (a *WorkloadAnnotatorImpl) Annotate(ctx context.Context, ref podscanner.WorkloadRef) (bool, error)
Annotate adds fortsa.scaffidi.net/restartedAt to the workload's pod template spec.template.metadata.annotations, triggering a rolling restart. When annotationCooldown is set, skips re-annotating if the workload was annotated within that duration. Returns (true, nil) when a patch was applied, (false, nil) when skipped or unsupported kind, (false, err) on error.