Skip to content

Commit

Permalink
simplify setting of humanReadableSize
Browse files Browse the repository at this point in the history
Co-authored-by: Hidde Beydals <hiddeco@users.noreply.github.com>
Signed-off-by: Max Jonas Werner <mail@makk.es>
  • Loading branch information
2 people authored and Max Jonas Werner committed Apr 22, 2022
1 parent b907001 commit 824e4a3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions controllers/helmrepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,9 @@ func (r *HelmRepositoryReconciler) notify(oldObj, newObj *sourcev1.HelmRepositor
sourcev1.GroupVersion.Group + "/checksum": newObj.Status.Artifact.Checksum,
}

size := newObj.Status.Artifact.Size
var humanReadableSize string
if size != nil {
humanReadableSize := "unknown size"
if newObj.Status.Artifact.Size != nil {
humanReadableSize = fmt.Sprintf("size %s", units.HumanSize(float64(*size)))
} else {
humanReadableSize = "unknown size"
}

var oldChecksum string
Expand Down

0 comments on commit 824e4a3

Please sign in to comment.