Skip to content

Commit

Permalink
Implement garbage collection action (findings)
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Nov 20, 2024
1 parent f00710e commit e71521b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/controller/actions/render/render_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ func DefaultCachingKeyFn(_ context.Context, rr *types.ReconciliationRequest) ([]
binary.PutVarint(instanceGeneration, rr.Instance.GetGeneration())

if _, err := hash.Write([]byte(rr.Instance.GetUID())); err != nil {
return nil, fmt.Errorf("unable to calculate checksum of reconciliation object: %w", err)
return nil, fmt.Errorf("failed to hash instance: %w", err)
}
if _, err := hash.Write(dsciGeneration); err != nil {
return nil, fmt.Errorf("unable to calculate checksum of reconciliation object: %w", err)
return nil, fmt.Errorf("failed to hash dsci generation: %w", err)
}
if _, err := hash.Write(instanceGeneration); err != nil {
return nil, fmt.Errorf("unable to calculate checksum of reconciliation object: %w", err)
return nil, fmt.Errorf("failed to hash instance generation: %w", err)
}
if _, err := hash.Write([]byte(rr.Release.Name)); err != nil {
return nil, fmt.Errorf("unable to calculate checksum of reconciliation object: %w", err)
return nil, fmt.Errorf("failed to hash release: %w", err)
}
if _, err := hash.Write([]byte(rr.Release.Version.String())); err != nil {
return nil, fmt.Errorf("unable to calculate checksum of reconciliation object: %w", err)
return nil, fmt.Errorf("failed to hash release: %w", err)
}

for i := range rr.Manifests {
if _, err := hash.Write([]byte(rr.Manifests[i].String())); err != nil {
return nil, fmt.Errorf("unable to calculate checksum of reconciliation object: %w", err)
return nil, fmt.Errorf("failed to hash manifest: %w", err)
}
}
for i := range rr.Templates {
if _, err := hash.Write([]byte(rr.Templates[i].Path)); err != nil {
return nil, fmt.Errorf("unable to calculate checksum of reconciliation object: %w", err)
return nil, fmt.Errorf("failed to hash template: %w", err)
}
}

Expand Down

0 comments on commit e71521b

Please sign in to comment.