Skip to content

Commit 075b05e

Browse files
committed
Add new variable for pull progress information
1 parent c6620b5 commit 075b05e

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ env:
22
SETUP_GVM_VERSION: 'v0.5.0' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
33
DOCKER_COMPOSE_VERSION: "v2.17.2"
44
ELASTIC_PACKAGE_COMPOSE_DISABLE_ANSI: "true"
5+
ELASTIC_PACKAGE_COMPOSE_DISABLE_PROGRESS_INFORMATION: "true"
56
KIND_VERSION: 'v0.17.0'
67
K8S_VERSION: 'v1.26.0'
78

internal/compose/compose.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,19 @@ const (
3131
waitForHealthyInterval = 1 * time.Second
3232
)
3333

34-
var DisableANSIComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_ANSI")
34+
var (
35+
DisableANSIComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_ANSI")
36+
DisablePullProgressInformationEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_PULL_PROGRESS_INFORMATION")
37+
)
3538

3639
// Project represents a Docker Compose project.
3740
type Project struct {
3841
name string
3942
composeFilePaths []string
4043

41-
dockerComposeV1 bool
42-
disableANSI bool
44+
dockerComposeV1 bool
45+
disableANSI bool
46+
disablePullProgressInformation bool
4347
}
4448

4549
// Config represents a Docker Compose configuration file.
@@ -192,14 +196,19 @@ func NewProject(name string, paths ...string) (*Project, error) {
192196
c.disableANSI = true
193197
}
194198

199+
v, ok = os.LookupEnv(DisablePullProgressInformationEnv)
200+
if ok && strings.ToLower(v) != "false" {
201+
c.disablePullProgressInformation = true
202+
}
203+
195204
return &c, nil
196205
}
197206

198207
// Up brings up a Docker Compose project.
199208
func (p *Project) Up(opts CommandOptions) error {
200209
args := p.baseArgs()
201210
args = append(args, "up")
202-
if p.disableANSI {
211+
if p.disablePullProgressInformation {
203212
args = append(args, "--quiet-pull")
204213
}
205214
args = append(args, opts.ExtraArgs...)
@@ -277,7 +286,7 @@ func (p *Project) Config(opts CommandOptions) (*Config, error) {
277286
func (p *Project) Pull(opts CommandOptions) error {
278287
args := p.baseArgs()
279288
args = append(args, "pull")
280-
if p.disableANSI {
289+
if p.disablePullProgressInformation {
281290
args = append(args, "--quiet")
282291
}
283292
args = append(args, opts.ExtraArgs...)

0 commit comments

Comments
 (0)