Skip to content

Commit cf26cae

Browse files
authored
Merge pull request #678 from lluiscampos/MEN-8127-add-module-image-progressbar
MEN-8127: Fix output for `write module-image`
2 parents 669b478 + 2a494bc commit cf26cae

File tree

10 files changed

+34
-21
lines changed

10 files changed

+34
-21
lines changed

Diff for: LIC_FILES_CHKSUM.sha256

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Apache 2.0 licenses.
22
38791d93beae962b266e11ac888ea2af4f07578b272c2f9dcb05f54f32960a76 LICENSE
33
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 vendor/github.com/minio/sha256-simd/LICENSE
4-
8f5d89b47d7a05a199b77b7e0f362dad391d451ebda4ef48ba11c50c071564c7 vendor/github.com/mendersoftware/progressbar/LICENSE
4+
132fb47b89947cd5f98e380186bc412af5561c70669d37d3a83b36f03a0ddae5 vendor/github.com/mendersoftware/progressbar/LICENSE
55
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 vendor/google.golang.org/genproto/LICENSE
66
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 vendor/google.golang.org/genproto/googleapis/api/LICENSE
77
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 vendor/google.golang.org/genproto/googleapis/rpc/LICENSE

Diff for: cli/cli.go

+4
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ func getCliContext() *cli.App {
423423
},
424424
softwareVersionValue,
425425
softwareFilesystem,
426+
cli.BoolFlag{
427+
Name: "no-progress",
428+
Usage: "Suppress the progressbar output",
429+
},
426430
}
427431
writeModuleCommand.Before = applyCompressionInCommand
428432

Diff for: cli/write.go

+7
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,13 @@ func writeModuleImage(ctx *cli.Context) error {
813813
return err
814814
}
815815

816+
if !ctx.Bool("no-progress") {
817+
ctx, cancel := context.WithCancel(context.Background())
818+
go reportProgress(ctx, aw.State)
819+
defer cancel()
820+
aw.ProgressWriter = utils.NewProgressWriter()
821+
}
822+
816823
err = aw.WriteArtifact(
817824
&awriter.WriteArtifactArgs{
818825
Format: "mender",

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/klauspost/pgzip v1.2.6
1515
github.com/lestrrat-go/jwx v1.2.30
1616
github.com/mendersoftware/openssl v1.1.1-0.20221101135106-cb94d0a179f8
17-
github.com/mendersoftware/progressbar v0.0.3
17+
github.com/mendersoftware/progressbar v0.0.4
1818
github.com/minio/sha256-simd v1.0.1
1919
github.com/pkg/errors v0.9.1
2020
github.com/sirupsen/logrus v1.9.3

Diff for: go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ github.com/mendersoftware/openssl v1.1.1-0.20221101135106-cb94d0a179f8 h1:LO1M21
176176
github.com/mendersoftware/openssl v1.1.1-0.20221101135106-cb94d0a179f8/go.mod h1:tikEC94q+Y0TU6r19L6mHzwruoTNYPEkrQPvsHEcQyU=
177177
github.com/mendersoftware/progressbar v0.0.3 h1:AUdBGPvXO0l9i39rmXKZbEAPet2FzBeiG8b30D5/2Vc=
178178
github.com/mendersoftware/progressbar v0.0.3/go.mod h1:NYaLNLhy3UXkRweGjhR3We3Q1ngmUmOWjC3+m8EzwjE=
179+
github.com/mendersoftware/progressbar v0.0.4 h1:R2uO9WiNRwF4pL278KlzSFFeIq4GBK2bSg1uD9uy9MI=
180+
github.com/mendersoftware/progressbar v0.0.4/go.mod h1:4opIJf3RMZWokFEMM7z1EdPjWtVWShdy9RvUDyHqmSk=
179181
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
180182
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
181183
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=

Diff for: vendor/github.com/mendersoftware/progressbar/LICENSE

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/github.com/mendersoftware/progressbar/LIC_FILES_CHKSUM.sha256

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/github.com/mendersoftware/progressbar/README.md

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/github.com/mendersoftware/progressbar/progress.go

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/modules.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ github.com/mattn/go-isatty
257257
## explicit
258258
github.com/mendersoftware/openssl
259259
github.com/mendersoftware/openssl/utils
260-
# github.com/mendersoftware/progressbar v0.0.3
261-
## explicit; go 1.15
260+
# github.com/mendersoftware/progressbar v0.0.4
261+
## explicit; go 1.17
262262
github.com/mendersoftware/progressbar
263263
# github.com/minio/sha256-simd v1.0.1
264264
## explicit; go 1.17

0 commit comments

Comments
 (0)