From e345e71eca32f968570fdf0b3f097d2c69c87cb5 Mon Sep 17 00:00:00 2001 From: Sunny Date: Mon, 4 Jul 2022 18:32:46 +0530 Subject: [PATCH] Minor comment updates - Update the comments around artifact retention fields in Storage. - Update the comments around reconcileStorage regarding artifact retention and garbage collection. Signed-off-by: Sunny --- controllers/bucket_controller.go | 5 +++-- controllers/gitrepository_controller.go | 2 +- controllers/helmchart_controller.go | 5 +++-- controllers/helmrepository_controller.go | 5 +++-- controllers/storage.go | 8 ++++---- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/controllers/bucket_controller.go b/controllers/bucket_controller.go index 742483808..eaff174c4 100644 --- a/controllers/bucket_controller.go +++ b/controllers/bucket_controller.go @@ -417,8 +417,9 @@ func (r *BucketReconciler) notify(ctx context.Context, oldObj, newObj *sourcev1. // reconcileStorage ensures the current state of the storage matches the // desired and previously observed state. // -// All Artifacts for the object except for the current one in the Status are -// garbage collected from the Storage. +// The garbage collection is executed based on the flag configured settings and +// may remove files that are beyond their TTL or the maximum number of files +// to survive a collection cycle. // If the Artifact in the Status of the object disappeared from the Storage, // it is removed from the object. // If the object does not have an Artifact in its Status, a Reconciling diff --git a/controllers/gitrepository_controller.go b/controllers/gitrepository_controller.go index d4565ed96..98dd98c5c 100644 --- a/controllers/gitrepository_controller.go +++ b/controllers/gitrepository_controller.go @@ -359,7 +359,7 @@ func (r *GitRepositoryReconciler) shouldNotify(oldObj, newObj *sourcev1.GitRepos // reconcileStorage ensures the current state of the storage matches the // desired and previously observed state. // -// The garbage collection is executed based on the flag based settings and +// The garbage collection is executed based on the flag configured settings and // may remove files that are beyond their TTL or the maximum number of files // to survive a collection cycle. // If the Artifact in the Status of the object disappeared from the Storage, diff --git a/controllers/helmchart_controller.go b/controllers/helmchart_controller.go index ab0e73627..1e9581b70 100644 --- a/controllers/helmchart_controller.go +++ b/controllers/helmchart_controller.go @@ -332,8 +332,9 @@ func (r *HelmChartReconciler) notify(ctx context.Context, oldObj, newObj *source // reconcileStorage ensures the current state of the storage matches the // desired and previously observed state. // -// All Artifacts for the object except for the current one in the Status are -// garbage collected from the Storage. +// The garbage collection is executed based on the flag configured settings and +// may remove files that are beyond their TTL or the maximum number of files +// to survive a collection cycle. // If the Artifact in the Status of the object disappeared from the Storage, // it is removed from the object. // If the object does not have an Artifact in its Status, a Reconciling diff --git a/controllers/helmrepository_controller.go b/controllers/helmrepository_controller.go index 0b58c2af1..6dff9e575 100644 --- a/controllers/helmrepository_controller.go +++ b/controllers/helmrepository_controller.go @@ -302,8 +302,9 @@ func (r *HelmRepositoryReconciler) notify(ctx context.Context, oldObj, newObj *s // reconcileStorage ensures the current state of the storage matches the // desired and previously observed state. // -// All Artifacts for the object except for the current one in the Status are -// garbage collected from the Storage. +// The garbage collection is executed based on the flag configured settings and +// may remove files that are beyond their TTL or the maximum number of files +// to survive a collection cycle. // If the Artifact in the Status of the object disappeared from the Storage, // it is removed from the object. // If the object does not have an Artifact in its Status, a Reconciling diff --git a/controllers/storage.go b/controllers/storage.go index 13f1fa0aa..fc90cb9d2 100644 --- a/controllers/storage.go +++ b/controllers/storage.go @@ -54,12 +54,12 @@ type Storage struct { // Hostname is the file server host name used to compose the artifacts URIs. Hostname string `json:"hostname"` - // ArtifactRetentionTTL is the maximum number of artifacts to be kept in storage - // after a garbage collection. + // ArtifactRetentionTTL is the duration of time that artifacts will be kept + // in storage before being garbage collected. ArtifactRetentionTTL time.Duration `json:"artifactRetentionTTL"` - // ArtifactRetentionRecords is the duration of time that artifacts will be kept in - // storage before being garbage collected. + // ArtifactRetentionRecords is the maximum number of artifacts to be kept in + // storage after a garbage collection. ArtifactRetentionRecords int `json:"artifactRetentionRecords"` }