Skip to content

Commit 18c4d4a

Browse files
makkeshiddeco
andauthored
simplify setting of humanReadableSize
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
1 parent b907001 commit 18c4d4a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

controllers/helmrepository_controller.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,9 @@ func (r *HelmRepositoryReconciler) notify(oldObj, newObj *sourcev1.HelmRepositor
255255
sourcev1.GroupVersion.Group + "/checksum": newObj.Status.Artifact.Checksum,
256256
}
257257

258-
size := newObj.Status.Artifact.Size
259-
var humanReadableSize string
260-
if size != nil {
258+
humanReadableSize := "unknown size"
259+
if newObj.Status.Artifact.Size != nil {
261260
humanReadableSize = fmt.Sprintf("size %s", units.HumanSize(float64(*size)))
262-
} else {
263-
humanReadableSize = "unknown size"
264261
}
265262

266263
var oldChecksum string

0 commit comments

Comments
 (0)