Skip to content

Commit

Permalink
PRODENG-2718 update copyright year (#507)
Browse files Browse the repository at this point in the history
* PRODENG-2718 update copyright year

- updated copyright year string in apply command (the only place I could
  find it)

Signed-off-by: James Nesbitt <[email protected]>

* PRODENG-2718 new linting failures

- int64->uint64 conversions can't be fixed, had to be escaped. File size
  can neven be negative so the issue is a false positive.

Signed-off-by: James Nesbitt <[email protected]>

---------

Signed-off-by: James Nesbitt <[email protected]>
  • Loading branch information
james-nesbitt committed Sep 17, 2024
1 parent 263740b commit 1ddcbd2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func NewApplyCommand() *cli.Command {
if !ctx.Bool("disable-logo") {
os.Stdout.WriteString(logo.Logo)
}
fmt.Fprintf(os.Stdout, " Mirantis Launchpad (c) 2022 Mirantis, Inc. %s\n\n", version.Version)
fmt.Fprintf(os.Stdout, " Mirantis Launchpad (c) 2024 Mirantis, Inc. %s\n\n", version.Version)
}

err = product.Apply(ctx.Bool("disable-cleanup"), ctx.Bool("force"), ctx.Int("concurrency"), ctx.Bool("force-upgrade"))
Expand Down
2 changes: 1 addition & 1 deletion pkg/mke/mke.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func writeBundle(bundleDir string, bundle *zip.Reader) error {
if err != nil {
return fmt.Errorf("error while reading file %s: %w", zipFile.Name, err)
}
mode := int32(0o644)
mode := uint32(0o644)
if strings.Contains(zipFile.Name, "key.pem") {
mode = 0o600
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/product/mke/api/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,17 @@ func (h *Host) WriteFileLarge(src, dst string) error {
return fmt.Errorf("failed to stat file: %w", err)
}
size := stat.Size()
usize := uint64(size) //nolint: gosec

log.Infof("%s: uploading %s to %s", h, byteutil.FormatBytes(uint64(stat.Size())), dst)
log.Infof("%s: uploading %s to %s", h, byteutil.FormatBytes(usize), dst)

if err := h.Connection.Upload(src, dst); err != nil {
return fmt.Errorf("upload failed: %w", err)
}

duration := time.Since(startTime).Seconds()
speed := float64(size) / duration
log.Infof("%s: transferred %s in %.1f seconds (%s/s)", h, byteutil.FormatBytes(uint64(size)), duration, byteutil.FormatBytes(uint64(speed)))
log.Infof("%s: transferred %s in %.1f seconds (%s/s)", h, byteutil.FormatBytes(usize), duration, byteutil.FormatBytes(uint64(speed)))

return nil
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/product/mke/phase/upload_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ func (p *LoadImages) HostFilterFunc(h *api.Host) bool {
h.Metadata.ImagesToUpload = append(h.Metadata.ImagesToUpload, imagePath)
info, err := entry.Info()
if err == nil {
h.Metadata.TotalImageBytes += uint64(info.Size())
usize := uint64(info.Size()) //nolint: gosec
h.Metadata.TotalImageBytes += usize
}
}

Expand Down

0 comments on commit 1ddcbd2

Please sign in to comment.