Commit Graph

3394 Commits

Author SHA1 Message Date
Ulysses Souza 96cbb1cbcf Add "style" tag to gocritic
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:06 +02:00
Ulysses Souza d42adf6efb Add "opinionated" tag to gocritic
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:06 +02:00
Ulysses Souza a81f23a199 Add "diagnostic" tag to gocritic
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:06 +02:00
Ulysses Souza 2e96829607 Add gocritic to linters
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-07-13 19:33:03 +02:00
Guillaume Lours 923e01d151
Merge pull request #9645 from thaJeztah/bump_go_1.18.4
update go to 1.18.4
2022-07-13 12:50:15 +02:00
Sebastiaan van Stijn d54cd0445e
update go to 1.18.4
go1.18.4 (released 2022-07-12) includes security fixes to the compress/gzip,
encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath
packages, as well as bug fixes to the compiler, the go command, the linker,
the runtime, and the runtime/metrics package. See the Go 1.18.4 milestone on the
issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.18.4+label%3ACherryPickApproved

This update addresses:

CVE-2022-1705, CVE-2022-1962, CVE-2022-28131, CVE-2022-30630, CVE-2022-30631,
CVE-2022-30632, CVE-2022-30633, CVE-2022-30635, and CVE-2022-32148.

Full diff: https://github.com/golang/go/compare/go1.18.3...go1.18.4

From the security announcement;
https://groups.google.com/g/golang-announce/c/nqrv9fbR0zE

We have just released Go versions 1.18.4 and 1.17.12, minor point releases. These
minor releases include 9 security fixes following the security policy:

- net/http: improper sanitization of Transfer-Encoding header

  The HTTP/1 client accepted some invalid Transfer-Encoding headers as indicating
  a "chunked" encoding. This could potentially allow for request smuggling, but
  only if combined with an intermediate server that also improperly failed to
  reject the header as invalid.

  This is CVE-2022-1705 and https://go.dev/issue/53188.

- When `httputil.ReverseProxy.ServeHTTP` was called with a `Request.Header` map
  containing a nil value for the X-Forwarded-For header, ReverseProxy would set
  the client IP as the value of the X-Forwarded-For header, contrary to its
  documentation. In the more usual case where a Director function set the
  X-Forwarded-For header value to nil, ReverseProxy would leave the header
  unmodified as expected.

  This is https://go.dev/issue/53423 and CVE-2022-32148.

  Thanks to Christian Mehlmauer for reporting this issue.

- compress/gzip: stack exhaustion in Reader.Read

  Calling Reader.Read on an archive containing a large number of concatenated
  0-length compressed files can cause a panic due to stack exhaustion.

  This is CVE-2022-30631 and Go issue https://go.dev/issue/53168.

- encoding/xml: stack exhaustion in Unmarshal

  Calling Unmarshal on a XML document into a Go struct which has a nested field
  that uses the any field tag can cause a panic due to stack exhaustion.

  This is CVE-2022-30633 and Go issue https://go.dev/issue/53611.

- encoding/xml: stack exhaustion in Decoder.Skip

  Calling Decoder.Skip when parsing a deeply nested XML document can cause a
  panic due to stack exhaustion. The Go Security team discovered this issue, and
  it was independently reported by Juho Nurminen of Mattermost.

  This is CVE-2022-28131 and Go issue https://go.dev/issue/53614.

- encoding/gob: stack exhaustion in Decoder.Decode

  Calling Decoder.Decode on a message which contains deeply nested structures
  can cause a panic due to stack exhaustion.

  This is CVE-2022-30635 and Go issue https://go.dev/issue/53615.

- path/filepath: stack exhaustion in Glob

  Calling Glob on a path which contains a large number of path separators can
  cause a panic due to stack exhaustion.

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2022-30632 and Go issue https://go.dev/issue/53416.

- io/fs: stack exhaustion in Glob

  Calling Glob on a path which contains a large number of path separators can
  cause a panic due to stack exhaustion.

  This is CVE-2022-30630 and Go issue https://go.dev/issue/53415.

- go/parser: stack exhaustion in all Parse* functions

  Calling any of the Parse functions on Go source code which contains deeply
  nested types or declarations can cause a panic due to stack exhaustion.

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2022-1962 and Go issue https://go.dev/issue/53616.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-13 12:40:24 +02:00
Guillaume Lours 9fdd7d81b3
Merge pull request #9640 from glours/fix-close-network-name-issue
Fix issue with close networks name on up and down command
2022-07-13 10:46:13 +02:00
Guillaume Lours 6c8ff02c07
Merge pull request #9579 from paroque28/patch-1
build.go: initialize CustomLabels map if nil
2022-07-12 12:44:49 +02:00
Pablo Rodriguez Quesada eb06e1ca56
build.go: Access customLabels directly instead of by reference
Accesing the map directly instead of the copy value, otherwise the label doesn't get set.

Signed-off-by: Pablo Rodriguez <pablo.aarch64@gmail.com>
2022-07-11 08:52:23 -06:00
Guillaume Lours 50aa9750ee
check the exact network's name before creating or stopping it
NetworkList API doesn't return the extact name match, so we can retrieve more than one network with a request

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-11 12:17:22 +02:00
Guillaume Lours 5bc4016e70
Merge pull request #9626 from Oriun/patch-1
Fix typo in compose pull documentation
2022-07-08 13:55:00 +02:00
Guillaume Lours ea1ac9d7b7
Merge pull request #9631 from docker/dependabot/go_modules/github.com/cnabio/cnab-to-oci-0.3.5
build(deps): bump github.com/cnabio/cnab-to-oci from 0.3.4 to 0.3.5
2022-07-07 12:11:04 +02:00
dependabot[bot] b8a53cd2a5
build(deps): bump github.com/cnabio/cnab-to-oci from 0.3.4 to 0.3.5
Bumps [github.com/cnabio/cnab-to-oci](https://github.com/cnabio/cnab-to-oci) from 0.3.4 to 0.3.5.
- [Release notes](https://github.com/cnabio/cnab-to-oci/releases)
- [Commits](https://github.com/cnabio/cnab-to-oci/compare/v0.3.4...v0.3.5)

---
updated-dependencies:
- dependency-name: github.com/cnabio/cnab-to-oci
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 10:01:05 +00:00
Guillaume Lours 7969667097
Merge pull request #9623 from glours/add-build-and-run-e2e-targets
add new targets to build Compose binary before running e2e tests
2022-07-05 16:45:43 +02:00
Guillaume Lours 40063b4faa
Merge pull request #9615 from glours/use-env-secret-on-build
add support of environment secret during build step
2022-07-05 16:36:40 +02:00
Emmanuel Nuiro f06ab29a84 Fix typo in docker_compose_pull
Signed-off-by: Emmanuel Nuiro <emmanuel@nuiro.me>
2022-07-04 22:29:06 +02:00
Emmanuel Nuiro 7f5c166ec9 Fix typo in compose pull documentation
There was an invalid character between the two backticks at the end of the last snippet, causing the styling to break on the online documentation.

Signed-off-by: Emmanuel Nuiro <emmanuel@nuiro.me>
2022-07-04 21:45:53 +02:00
Guillaume Lours 978b2f8265
add new targets to build Compose binary before running e2e tests
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-04 15:53:08 +02:00
Guillaume Lours 83744f7e99
Merge pull request #9619 from Jeldo/Fix-syntax-error-on-golangci-run-configuration
Fix golangci syntax error in run configuration
2022-07-04 14:40:11 +02:00
Guillaume Lours 5a1fea8272
Merge pull request #9507 from TheodosiouTh/tc/simplify-flag-conversion
TC: Use switch case to simplify flag conversion and avoid multiple if statements
2022-07-04 09:19:21 +02:00
TaeyoungKwak 94f50b520c Fix golangci syntax error in run configuration
Signed-off-by: TaeyoungKwak <astrokwak@gmail.com>
2022-07-03 01:45:52 +09:00
Guillaume Lours 4debb133a7
add support of environment secret during build step
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-01 11:21:49 +02:00
ThedosiouTh 115ac6d529 Use switch/case instead of static map for simplicity
Signed-off-by: ThedosiouTh <thanosthd@gmail.com>
2022-06-30 18:50:24 +03:00
ThedosiouTh 8648f30351 TC: Add missing tests for argumetns
Signed-off-by: ThedosiouTh <thanosthd@gmail.com>
2022-06-30 18:50:24 +03:00
ThedosiouTh 9542bdf445 TC: fix naming
Signed-off-by: ThedosiouTh <thanosthd@gmail.com>
2022-06-30 18:50:24 +03:00
ThedosiouTh 40f0dbd971 TC: Use map to simplify flag conversion and avoid multilple if statements
Signed-off-by: ThedosiouTh <thanosthd@gmail.com>
2022-06-30 18:50:24 +03:00
Guillaume Lours ff2bf78570
Merge pull request #9612 from milas/e2e-start-stop
e2e: add more start/stop test cases
2022-06-30 17:31:09 +02:00
Milas Bowman 4aa8c4a1e5 e2e: add more start/stop test cases
* Starting a service that's already running
* Stopping a service that's already stopped
* Starting/stopping multiple services (by name) at once

Also renamed a test that was about `up` behavior but was
misleadingly labeled start/stop.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-30 09:52:14 -04:00
Milas Bowman 06649442eb
Merge pull request #9609 from milas/e2e-pause
e2e: split out `pause` tests and add more cases
2022-06-30 08:42:59 -04:00
Guillaume Lours 19f316eec3
Merge pull request #9611 from docker/dependabot/go_modules/github.com/stretchr/testify-1.8.0
build(deps): bump github.com/stretchr/testify from 1.7.5 to 1.8.0
2022-06-30 11:38:58 +02:00
dependabot[bot] 1074074df2
build(deps): bump github.com/stretchr/testify from 1.7.5 to 1.8.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.5 to 1.8.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.5...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-30 09:31:44 +00:00
Guillaume Lours cd940693aa
Merge pull request #9049 from ndeloof/9044
(re)start should not impact one-off containers
2022-06-29 10:43:10 +02:00
Laura Brehm 96b152f705 Update logic to keep `compose stop` and `restart` from affecting one-offs
Also add e2e tests.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-06-29 00:58:02 +02:00
Milas Bowman 8e7b6582d4
Merge pull request #9595 from abhinavnair/replace-ioutil
Replace deprecated ioutil pkg with os & io
2022-06-28 15:08:57 -04:00
Nick Sieger 391d2e02ff
Merge pull request #9592 from nicksieger/fix-panic-empty-string-arg
fix: panic caused by empty string argument
2022-06-28 14:07:04 -05:00
Milas Bowman 26014d49a5 e2e: split out `pause` tests and add more cases
Pause/unpause was being partially tested under the start/stop test.
This removes it from that test and adds dedicated pause + unpause
tests.

Note that the tests assert on current behavior, though it's been
noted where that is undesirable due to divergence from the Docker
CLI. Will change the behavior + update tests in a subsequent PR.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-28 15:06:17 -04:00
Nick Sieger fd5e8b8c28
fix: panic caused by empty string argument
Signed-off-by: Nick Sieger <nick@nicksieger.com>
2022-06-28 10:18:38 -05:00
Guillaume Lours cc2dc868c2
Merge pull request #9583 from crazy-max/docs-workflow
ci: release workflow to open a PR on docs repo with latest changes
2022-06-28 14:26:21 +02:00
Guillaume Lours 908a59af4c
Merge pull request #9607 from docker/dependabot/go_modules/github.com/hashicorp/go-version-1.6.0
build(deps): bump github.com/hashicorp/go-version from 1.5.0 to 1.6.0
2022-06-28 11:35:38 +02:00
dependabot[bot] 7e6daa8d01
build(deps): bump github.com/hashicorp/go-version from 1.5.0 to 1.6.0
Bumps [github.com/hashicorp/go-version](https://github.com/hashicorp/go-version) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/hashicorp/go-version/releases)
- [Changelog](https://github.com/hashicorp/go-version/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-version/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-version
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 09:28:44 +00:00
Abhinav Nair a783cc4574
Blacklist ioutil pkg in golangci-lint
This is to prevent anyone from accidentally importing the pkg

Signed-off-by: Abhinav Nair <11939846+abhinavnair@users.noreply.github.com>
2022-06-28 09:20:29 +08:00
Laura Brehm 3ccf4349e7
Merge pull request #9572 from laurazard/dont-wait-for-oneshots
Use appropriate dependency condition for one-shot containers when running `compose up --wait`
2022-06-26 14:48:49 +02:00
Laura Brehm 74fd14ec65 Use alpine instead of ubuntu for E2E compose file, no need to include version
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-06-26 14:41:23 +02:00
Abhinav Nair 11f2f2dbc4
Replace deprecated ioutil pkg with os & io
As of Go 1.16, the same functionality is now provided by package io or
package os, and those implementations should be preferred in new code.

So replacing all usage of ioutil pkg with io & os.

Signed-off-by: Abhinav Nair <11939846+abhinavnair@users.noreply.github.com>
2022-06-25 14:06:10 +08:00
Guillaume Lours 2cd9c0df5a
Merge pull request #9587 from milas/build-order-classic
build: respect dependency order for classic builder
2022-06-24 22:24:22 +02:00
Milas Bowman ec0efec839 test: add copyright notice
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2022-06-24 16:16:53 -04:00
CrazyMax 0a53d93338
ci: release workflow to open a PR on docs repo with latest changes
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-06-24 18:40:08 +02:00
Guillaume Lours dbf52d3f45
Merge pull request #9590 from docker/dependabot/go_modules/github.com/stretchr/testify-1.7.5
build(deps): bump github.com/stretchr/testify from 1.7.4 to 1.7.5
2022-06-24 11:36:32 +02:00
dependabot[bot] f972803104
build(deps): bump github.com/stretchr/testify from 1.7.4 to 1.7.5
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.4 to 1.7.5.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.4...v1.7.5)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-24 09:28:09 +00:00
Guillaume Lours 4aa3e246b7
Merge pull request #9585 from milas/net-ambiguity
networks: prevent issues due to duplicate names
2022-06-24 11:08:52 +02:00