diff --git a/.github/workflows/rollback.yml b/.github/workflows/rollback.yml index d3e7a8588c..1e2b24b3a6 100644 --- a/.github/workflows/rollback.yml +++ b/.github/workflows/rollback.yml @@ -165,7 +165,7 @@ jobs: mkdir -p ${{ env.SSM_ARTIFACT_ROOT }} for region in ${{ matrix.regions }}; do document_versions=$(aws ssm list-document-versions --name ${SSM_RELEASE_PACKAGE_NAME} --region ${region}) - document_version=$(echo $document_versions | docker run --rm -i stedolan/jq -c -r ".DocumentVersions|.[]|select(.VersionName==\"${{ github.event.inputs.rollback-version }}\")|.DocumentVersion") + document_version=$(echo $document_versions | docker run --rm -i ghcr.io/jqlang/jq -c -r ".DocumentVersions|.[]|select(.VersionName==\"${{ github.event.inputs.rollback-version }}\")|.DocumentVersion") if [[ -z $document_version ]]; then echo "Document version not found for ${{ github.event.inputs.rollback-version }} in ${region}" exit 1; diff --git a/VERSION b/VERSION index f0017ff768..e6eb0dda58 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.39.1 +v0.39.2 diff --git a/docs/releases/v0.39.2.md b/docs/releases/v0.39.2.md new file mode 100644 index 0000000000..9fa4a61b7e --- /dev/null +++ b/docs/releases/v0.39.2.md @@ -0,0 +1,9 @@ +# Changelog + +## [v0.39.2](/~https://github.com/aws-observability/aws-otel-collector/tree/v0.39.2) (2024-08-22) + +[Full Changelog](/~https://github.com/aws-observability/aws-otel-collector/compare/v0.39.1...v0.39.2) + +**Merged pull requests:** + +- Upgrade Docker to v25.0.6 [#2803](/~https://github.com/aws-observability/aws-otel-collector/pull/2803) \ No newline at end of file diff --git a/go.mod b/go.mod index b95649c5c1..ef20dd3223 100644 --- a/go.mod +++ b/go.mod @@ -156,7 +156,7 @@ require ( github.com/dennwc/varint v1.0.0 // indirect github.com/digitalocean/godo v1.109.0 // indirect github.com/distribution/reference v0.5.0 // indirect - github.com/docker/docker v25.0.5+incompatible // indirect + github.com/docker/docker v25.0.6+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect @@ -201,7 +201,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect - github.com/gophercloud/gophercloud v1.8.0 // indirect + github.com/gophercloud/gophercloud v1.14.0 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect diff --git a/go.sum b/go.sum index 6516fc48d0..397dfa1cd8 100644 --- a/go.sum +++ b/go.sum @@ -268,8 +268,8 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= -github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.6+incompatible h1:5cPwbwriIcsua2REJe8HqQV+6WlWc1byg2QSXzBxBGg= +github.com/docker/docker v25.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -482,8 +482,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/gophercloud/gophercloud v1.8.0 h1:TM3Jawprb2NrdOnvcHhWJalmKmAmOGgfZElM/3oBYCk= -github.com/gophercloud/gophercloud v1.8.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gophercloud/gophercloud v1.14.0 h1:Bt9zQDhPrbd4qX7EILGmy+i7GP35cc+AAL2+wIJpUE8= +github.com/gophercloud/gophercloud v1.14.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= diff --git a/testbed/go.mod b/testbed/go.mod index f6458fc1d1..4e878bb97a 100644 --- a/testbed/go.mod +++ b/testbed/go.mod @@ -86,7 +86,7 @@ require ( github.com/dennwc/varint v1.0.0 // indirect github.com/digitalocean/godo v1.109.0 // indirect github.com/distribution/reference v0.5.0 // indirect - github.com/docker/docker v25.0.5+incompatible // indirect + github.com/docker/docker v25.0.6+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect @@ -132,7 +132,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect - github.com/gophercloud/gophercloud v1.8.0 // indirect + github.com/gophercloud/gophercloud v1.14.0 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect diff --git a/testbed/go.sum b/testbed/go.sum index 0352f23b5e..0947f5d6b7 100644 --- a/testbed/go.sum +++ b/testbed/go.sum @@ -272,8 +272,8 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= -github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.6+incompatible h1:5cPwbwriIcsua2REJe8HqQV+6WlWc1byg2QSXzBxBGg= +github.com/docker/docker v25.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -490,8 +490,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/gophercloud/gophercloud v1.8.0 h1:TM3Jawprb2NrdOnvcHhWJalmKmAmOGgfZElM/3oBYCk= -github.com/gophercloud/gophercloud v1.8.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gophercloud/gophercloud v1.14.0 h1:Bt9zQDhPrbd4qX7EILGmy+i7GP35cc+AAL2+wIJpUE8= +github.com/gophercloud/gophercloud v1.14.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= diff --git a/tools/packaging/windows/aws-otel-collector.wxs b/tools/packaging/windows/aws-otel-collector.wxs index 638846c92e..6624b42dde 100644 --- a/tools/packaging/windows/aws-otel-collector.wxs +++ b/tools/packaging/windows/aws-otel-collector.wxs @@ -3,7 +3,7 @@ diff --git a/tools/release/image-mirror/go.mod b/tools/release/image-mirror/go.mod index fc56c7c05d..5f621874da 100644 --- a/tools/release/image-mirror/go.mod +++ b/tools/release/image-mirror/go.mod @@ -64,4 +64,4 @@ require ( // see /~https://github.com/aws-observability/aws-otel-collector/issues/977 exclude github.com/docker/distribution v2.8.0+incompatible -replace github.com/docker/docker v25.0.3+incompatible => github.com/docker/docker v25.0.5+incompatible +replace github.com/docker/docker v25.0.3+incompatible => github.com/docker/docker v25.0.6+incompatible diff --git a/tools/release/image-mirror/go.sum b/tools/release/image-mirror/go.sum index 9fd42599db..769f10a63d 100644 --- a/tools/release/image-mirror/go.sum +++ b/tools/release/image-mirror/go.sum @@ -49,8 +49,8 @@ github.com/docker/cli v24.0.0+incompatible h1:0+1VshNwBQzQAx9lOl+OYCTCEAD8fKs/qe github.com/docker/cli v24.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= -github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.6+incompatible h1:5cPwbwriIcsua2REJe8HqQV+6WlWc1byg2QSXzBxBGg= +github.com/docker/docker v25.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= diff --git a/tools/ssm/ssm_rollback_default_version.sh b/tools/ssm/ssm_rollback_default_version.sh index f8f01afbe5..d8f9326672 100644 --- a/tools/ssm/ssm_rollback_default_version.sh +++ b/tools/ssm/ssm_rollback_default_version.sh @@ -45,7 +45,7 @@ function parse_environment_input() { } function rollback_second_largest_target_document_as_default() { - document_version_names=$(aws ssm list-document-versions --name "${ssm_package_name}" --output json | docker run --rm -i stedolan/jq -c -r ".DocumentVersions|.[]|.VersionName" | sed 's/"//g' | sort -V -r) + document_version_names=$(aws ssm list-document-versions --name "${ssm_package_name}" --output json | docker run --rm -i ghcr.io/jqlang/jq -c -r ".DocumentVersions|.[]|.VersionName" | sed 's/"//g' | sort -V -r) # Convert document versions name to array # shellcheck disable=SC2206 @@ -66,7 +66,7 @@ function rollback_second_largest_target_document_as_default() { echo "Roll-back the default SSM version to ${rollback_version_name}" - rollback_document_version=$(aws ssm describe-document --name "${ssm_package_name}" --version-name "${rollback_version_name}" --output json | docker run --rm -i stedolan/jq -c -r ".Document|.DocumentVersion") + rollback_document_version=$(aws ssm describe-document --name "${ssm_package_name}" --version-name "${rollback_version_name}" --output json | docker run --rm -i ghcr.io/jqlang/jq -c -r ".Document|.DocumentVersion") aws ssm update-document-default-version --name "${ssm_package_name}" --document-version "${rollback_document_version}" } diff --git a/tools/workflow/docker-version-compare.sh b/tools/workflow/docker-version-compare.sh index a1b28f3ff2..aa095f8086 100644 --- a/tools/workflow/docker-version-compare.sh +++ b/tools/workflow/docker-version-compare.sh @@ -49,9 +49,9 @@ if [ -z "${REPO_NAME}" ]; then REPO_NAME="amazon/aws-otel-collector" fi -TOKEN=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${REPO_NAME}:pull" | docker run --rm -i stedolan/jq -c ".token" | sed 's/"//g') +TOKEN=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${REPO_NAME}:pull" | docker run --rm -i ghcr.io/jqlang/jq -c ".token" | sed 's/"//g') # retrieves all the available tags and sorts them in reverse version order -TAGS=$(curl -s "https://registry.hub.docker.com/v2/${REPO_NAME}/tags/list" -H "Authorization: Bearer ${TOKEN}" | docker run --rm -i stedolan/jq -c ".tags[]" | sed 's/"//g' | sort -V -r) +TAGS=$(curl -s "https://registry.hub.docker.com/v2/${REPO_NAME}/tags/list" -H "Authorization: Bearer ${TOKEN}" | docker run --rm -i ghcr.io/jqlang/jq -c ".tags[]" | sed 's/"//g' | sort -V -r) # get the first tag in the reversed list LATEST_VERSION=$(echo "${TAGS}" | sed -n '1p') diff --git a/tools/workflow/is-commit-benchmarked.sh b/tools/workflow/is-commit-benchmarked.sh index f2367bb9c0..2d02883228 100644 --- a/tools/workflow/is-commit-benchmarked.sh +++ b/tools/workflow/is-commit-benchmarked.sh @@ -28,7 +28,7 @@ HAS_COMMIT=false git switch "${GH_PAGES_BRANCH}" if [ -f benchmark/trend/data.js ]; then - HAS_COMMIT=$(sed "s/window.BENCHMARK_DATA = //" benchmark/trend/data.js | docker run --rm -i stedolan/jq -c ".entries.Benchmark | any(.commit.id == \"${COMMIT_SHA}\")") + HAS_COMMIT=$(sed "s/window.BENCHMARK_DATA = //" benchmark/trend/data.js | docker run --rm -i ghcr.io/jqlang/jq -c ".entries.Benchmark | any(.commit.id == \"${COMMIT_SHA}\")") fi echo "has-commit=${HAS_COMMIT}" >> "$GITHUB_OUTPUT" git checkout - diff --git a/vendor/github.com/docker/docker/api/swagger.yaml b/vendor/github.com/docker/docker/api/swagger.yaml index 201b549064..9749f61dc7 100644 --- a/vendor/github.com/docker/docker/api/swagger.yaml +++ b/vendor/github.com/docker/docker/api/swagger.yaml @@ -4938,7 +4938,7 @@ definitions: The version Go used to compile the daemon, and the version of the Go runtime in use. type: "string" - example: "go1.13.14" + example: "go1.21.12" Os: description: | The operating system that the daemon is running on ("linux" or "windows") diff --git a/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md b/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md index e13f9e17ef..dc38bf5871 100644 --- a/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md +++ b/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md @@ -1,3 +1,56 @@ +## v1.14.0 (2024-07-24) + +* [GH-3095](/~https://github.com/gophercloud/gophercloud/pull/3095) [neutron]: introduce Description argument for the portforwarding +* [GH-3098](/~https://github.com/gophercloud/gophercloud/pull/3098) [neutron]: introduce Stateful argument for the security groups +* [GH-3099](/~https://github.com/gophercloud/gophercloud/pull/3099) [networking]: subnet add field dns_publish_fixed_ip + +## v1.13.0 (2024-07-08) + +* [GH-3044](/~https://github.com/gophercloud/gophercloud/pull/3044) [v1] Add ci jobs for openstack caracal +* [GH-3073](/~https://github.com/gophercloud/gophercloud/pull/3073) [v1] Adding missing QoS field for router +* [GH-3080](/~https://github.com/gophercloud/gophercloud/pull/3080) [networking]: add BGP VPNs support (backport to 1.x) + +## v1.12.0 (2024-05-27) + +* [GH-2979](/~https://github.com/gophercloud/gophercloud/pull/2979) [v1] CI backports +* [GH-2985](/~https://github.com/gophercloud/gophercloud/pull/2985) [v1] baremetal: fix handling of the "fields" query argument +* [GH-2989](/~https://github.com/gophercloud/gophercloud/pull/2989) [v1] [CI] Fix portbiding tests +* [GH-2992](/~https://github.com/gophercloud/gophercloud/pull/2992) [v1] [CI] Fix portbiding tests +* [GH-2993](/~https://github.com/gophercloud/gophercloud/pull/2993) [v1] build(deps): bump EmilienM/devstack-action from 0.14 to 0.15 +* [GH-2998](/~https://github.com/gophercloud/gophercloud/pull/2998) [v1] testhelper: mark all helpers with t.Helper +* [GH-3043](/~https://github.com/gophercloud/gophercloud/pull/3043) [v1] CI: remove Zed from testing coverage + +## v1.11.0 (2024-03-07) + +This version reverts the inclusion of Context in the v1 branch. This inclusion +didn't add much value because no packages were using it; on the other hand, it +introduced a bug when using the Context property of the Provider client. + +## v1.10.0 (2024-02-27) **RETRACTED**: see /~https://github.com/gophercloud/gophercloud/issues/2969 + +* [GH-2893](/~https://github.com/gophercloud/gophercloud/pull/2893) [v1] authentication: Add WithContext functions +* [GH-2894](/~https://github.com/gophercloud/gophercloud/pull/2894) [v1] pager: Add WithContext functions +* [GH-2899](/~https://github.com/gophercloud/gophercloud/pull/2899) [v1] Authenticate with a clouds.yaml +* [GH-2917](/~https://github.com/gophercloud/gophercloud/pull/2917) [v1] Add ParseOption type to made clouds.Parse() more usable for optional With* funcs +* [GH-2924](/~https://github.com/gophercloud/gophercloud/pull/2924) [v1] build(deps): bump EmilienM/devstack-action from 0.11 to 0.14 +* [GH-2933](/~https://github.com/gophercloud/gophercloud/pull/2933) [v1] Fix AllowReauth reauthentication +* [GH-2950](/~https://github.com/gophercloud/gophercloud/pull/2950) [v1] compute: Use volumeID, not attachmentID for volume attachments + +## v1.9.0 (2024-02-02) **RETRACTED**: see /~https://github.com/gophercloud/gophercloud/issues/2969 + +New features and improvements: + +* [GH-2884](/~https://github.com/gophercloud/gophercloud/pull/2884) [v1] Context-aware methods to ProviderClient and ServiceClient +* [GH-2887](/~https://github.com/gophercloud/gophercloud/pull/2887) [v1] Add support of Flavors and FlavorProfiles for Octavia +* [GH-2875](/~https://github.com/gophercloud/gophercloud/pull/2875) [v1] [db/v1/instance]: adding support for availability_zone for a db instance + +CI changes: + +* [GH-2856](/~https://github.com/gophercloud/gophercloud/pull/2856) [v1] Fix devstack install on EOL magnum branches +* [GH-2857](/~https://github.com/gophercloud/gophercloud/pull/2857) [v1] Fix networking acceptance tests +* [GH-2858](/~https://github.com/gophercloud/gophercloud/pull/2858) [v1] build(deps): bump actions/upload-artifact from 3 to 4 +* [GH-2859](/~https://github.com/gophercloud/gophercloud/pull/2859) [v1] build(deps): bump github/codeql-action from 2 to 3 + ## v1.8.0 (2023-11-30) New features and improvements: diff --git a/vendor/github.com/gophercloud/gophercloud/params.go b/vendor/github.com/gophercloud/gophercloud/params.go index 17b200cd23..5abc2c5589 100644 --- a/vendor/github.com/gophercloud/gophercloud/params.go +++ b/vendor/github.com/gophercloud/gophercloud/params.go @@ -318,8 +318,15 @@ converted into query parameters based on a "q" tag. For example: will be converted into "?x_bar=AAA&lorem_ipsum=BBB". -The struct's fields may be strings, integers, or boolean values. Fields left at -their type's zero value will be omitted from the query. +The struct's fields may be strings, integers, slices, or boolean values. Fields +left at their type's zero value will be omitted from the query. + +Slice are handled in one of two ways: + + type struct Something { + Bar []string `q:"bar"` // E.g. ?bar=1&bar=2 + Baz []int `q:"baz" format="comma-separated"` // E.g. ?baz=1,2 + } */ func BuildQueryString(opts interface{}) (*url.URL, error) { optsValue := reflect.ValueOf(opts) @@ -358,16 +365,22 @@ func BuildQueryString(opts interface{}) (*url.URL, error) { case reflect.Bool: params.Add(tags[0], strconv.FormatBool(v.Bool())) case reflect.Slice: + var values []string switch v.Type().Elem() { case reflect.TypeOf(0): for i := 0; i < v.Len(); i++ { - params.Add(tags[0], strconv.FormatInt(v.Index(i).Int(), 10)) + values = append(values, strconv.FormatInt(v.Index(i).Int(), 10)) } default: for i := 0; i < v.Len(); i++ { - params.Add(tags[0], v.Index(i).String()) + values = append(values, v.Index(i).String()) } } + if sliceFormat := f.Tag.Get("format"); sliceFormat == "comma-separated" { + params.Add(tags[0], strings.Join(values, ",")) + } else { + params[tags[0]] = append(params[tags[0]], values...) + } case reflect.Map: if v.Type().Key().Kind() == reflect.String && v.Type().Elem().Kind() == reflect.String { var s []string diff --git a/vendor/github.com/gophercloud/gophercloud/provider_client.go b/vendor/github.com/gophercloud/gophercloud/provider_client.go index ce291a3ab3..6e57f48843 100644 --- a/vendor/github.com/gophercloud/gophercloud/provider_client.go +++ b/vendor/github.com/gophercloud/gophercloud/provider_client.go @@ -14,7 +14,7 @@ import ( // DefaultUserAgent is the default User-Agent string set in the request header. const ( - DefaultUserAgent = "gophercloud/v1.8.0" + DefaultUserAgent = "gophercloud/v1.14.0" DefaultMaxBackoffRetries = 60 ) diff --git a/vendor/modules.txt b/vendor/modules.txt index ffb71384e7..5335586ecb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -481,7 +481,7 @@ github.com/digitalocean/godo/metrics # github.com/distribution/reference v0.5.0 ## explicit; go 1.20 github.com/distribution/reference -# github.com/docker/docker v25.0.5+incompatible +# github.com/docker/docker v25.0.6+incompatible ## explicit github.com/docker/docker/api github.com/docker/docker/api/types @@ -766,7 +766,7 @@ github.com/googleapis/gax-go/v2/apierror github.com/googleapis/gax-go/v2/apierror/internal/proto github.com/googleapis/gax-go/v2/callctx github.com/googleapis/gax-go/v2/internal -# github.com/gophercloud/gophercloud v1.8.0 +# github.com/gophercloud/gophercloud v1.14.0 ## explicit; go 1.14 github.com/gophercloud/gophercloud github.com/gophercloud/gophercloud/openstack