diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 68ab2aa4e3..3a4d619861 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -2,6 +2,7 @@ env: SETUP_GVM_VERSION: 'v0.5.0' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151 DOCKER_COMPOSE_VERSION: "v2.17.2" ELASTIC_PACKAGE_COMPOSE_DISABLE_ANSI: "true" + ELASTIC_PACKAGE_COMPOSE_DISABLE_PULL_PROGRESS_INFORMATION: "true" KIND_VERSION: 'v0.17.0' K8S_VERSION: 'v1.26.0' diff --git a/internal/compose/compose.go b/internal/compose/compose.go index 035b98b60e..2d6ba3744f 100644 --- a/internal/compose/compose.go +++ b/internal/compose/compose.go @@ -31,15 +31,19 @@ const ( waitForHealthyInterval = 1 * time.Second ) -var DisableANSIComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_ANSI") +var ( + DisableANSIComposeEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_ANSI") + DisablePullProgressInformationEnv = environment.WithElasticPackagePrefix("COMPOSE_DISABLE_PULL_PROGRESS_INFORMATION") +) // Project represents a Docker Compose project. type Project struct { name string composeFilePaths []string - dockerComposeV1 bool - disableANSI bool + dockerComposeV1 bool + disableANSI bool + disablePullProgressInformation bool } // Config represents a Docker Compose configuration file. @@ -192,6 +196,11 @@ func NewProject(name string, paths ...string) (*Project, error) { c.disableANSI = true } + v, ok = os.LookupEnv(DisablePullProgressInformationEnv) + if ok && strings.ToLower(v) != "false" { + c.disablePullProgressInformation = true + } + return &c, nil } @@ -199,7 +208,7 @@ func NewProject(name string, paths ...string) (*Project, error) { func (p *Project) Up(opts CommandOptions) error { args := p.baseArgs() args = append(args, "up") - if p.disableANSI { + if p.disablePullProgressInformation { args = append(args, "--quiet-pull") } args = append(args, opts.ExtraArgs...) @@ -277,6 +286,9 @@ func (p *Project) Config(opts CommandOptions) (*Config, error) { func (p *Project) Pull(opts CommandOptions) error { args := p.baseArgs() args = append(args, "pull") + if p.disablePullProgressInformation { + args = append(args, "--quiet") + } args = append(args, opts.ExtraArgs...) args = append(args, opts.Services...) diff --git a/internal/stack/compose.go b/internal/stack/compose.go index a1e0bb00ef..8948f4d9b1 100644 --- a/internal/stack/compose.go +++ b/internal/stack/compose.go @@ -13,7 +13,6 @@ import ( "github.com/elastic/elastic-package/internal/compose" "github.com/elastic/elastic-package/internal/docker" "github.com/elastic/elastic-package/internal/install" - "github.com/elastic/elastic-package/internal/logger" ) type ServiceStatus struct { @@ -207,7 +206,6 @@ func dockerComposeStatus() ([]ServiceStatus, error) { if err != nil { return nil, err } - logger.Debugf("Adding Service: \"%v\"", service.Name) services = append(services, *service) }