helmrepo: rm stale condition when type switching

Remove stale condition from HelmRepo during garbage collection when a
type switch to OCI HelmRepo occurs. This ensures the OCI HelmRepo does
not have any conditions from the previous type.

Co-authored-by: Soule BA <soule@weave.works>
Signed-off-by: Sunny <darkowlzz@protonmail.com>
This commit is contained in:
Sunny 2022-05-31 03:42:54 +05:30
parent d22758643b
commit 9fe287d912
No known key found for this signature in database
GPG Key ID: 9F3D25DDFF7FA3CF
1 changed files with 2 additions and 2 deletions

View File

@ -577,8 +577,8 @@ func (r *HelmRepositoryReconciler) garbageCollect(ctx context.Context, obj *sour
// Clean status sub-resource
obj.Status.Artifact = nil
obj.Status.URL = ""
// Remove the condition as the artifact doesn't exist.
conditions.Delete(obj, sourcev1.ArtifactInStorageCondition)
// Remove any stale conditions.
obj.Status.Conditions = nil
return nil
}
if obj.GetArtifact() != nil {