Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(modules.gcloud): pass as ptr to allow request customization #1972

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

jboyens
Copy link
Contributor

@jboyens jboyens commented Dec 6, 2023

What does this PR do?

Fixes the GCloud modules to correctly pass the GenericContainerRequest into applyOptions as a pointer instead of copying the struct.

Currently, the modifications are done, but are thrown away because req is passed as a copy.

Why is it important?

Currently, any container customizations will completely be wiped out as the req param is copied into applyOptions

Related issues

  • None found.

How to test this PR

  1. Start on the current main branch
  2. Make an image modification (using WithImage()) verify that the image is NOT modified
  3. Apply this PR
  4. Redo the test from step 2 and verify that the image is now correctly modified

@jboyens jboyens requested a review from a team as a code owner December 6, 2023 00:28
Copy link

netlify bot commented Dec 6, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit a06c441
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/656fc019308eba00085cd025
😎 Deploy Preview https://deploy-preview-1972--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya mdelapenya self-assigned this Dec 6, 2023
@mdelapenya mdelapenya added the bug An issue with the library label Dec 6, 2023
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I'm so sorry for not having seen that before 🤦

Could you add a test demonstrating the bug (which does exist but want to be covered against potential future regressions)?

Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't mind, I'm going to merge this as is, as the existing tests are enough for the purpose.

Thanks for resolving this bug!

@mdelapenya mdelapenya merged commit 6a2a8b8 into testcontainers:main Jan 8, 2024
111 of 112 checks passed
mdelapenya added a commit to jespino/testcontainers-go that referenced this pull request Jan 9, 2024
* main:
  chore: move internal/testcontainersdocker package's files to internal/core (testcontainers#2083)
  GenericContainer: in case of error: return a reference to the failed container (testcontainers#2082)
  [breaking] Add err chan to log producer and don't panic on error (testcontainers#1971)
  chore: enrich HTTP headers to the Docker daemon with the project path (testcontainers#2080)
  fix: align codeql versions in GH workflow (testcontainers#2081)
  chore(deps): bump go.mongodb.org/mongo-driver in /modules/mongodb (testcontainers#2065)
  chore(deps): bump github.com/shirou/gopsutil/v3 from 3.23.11 to 3.23.12 (testcontainers#2068)
  fix(modules.gcloud): pass as ptr to allow request customization (testcontainers#1972)
  chore(deps): bump github.com/twmb/franz-go in /modules/redpanda (testcontainers#2072)
  chore(deps): bump k8s.io/api, k8s.io/apimachinery, k8s.io/client-go from 0.28.4 to 0.29.0 in /modules/k3s (testcontainers#2078)
  chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 (testcontainers#2066)
  chore(deps): bump github.com/google/uuid from 1.4.0 to 1.5.0 (testcontainers#2077)
  bump google.golang.org/api from 0.153.0 to 0.154.0, cloud.google.com/go/spanner from 1.53.1 to 1.54.0, bump google.golang.org/grpc from 1.59.0 to 1.60.1 in /modules/gcloud (testcontainers#2076)
  chore(deps): bump github.com/aws/aws-sdk-go-v2 from 1.23.5 to 1.24.0 (credentials from 1.16.9 to 1.16.13, service/s3 from 1.47.1 to 1.47.7)  in /modules/localstack (testcontainers#2075)
  chore(deps): bump github/codeql-action from 2 to 3 (testcontainers#2056)
  chore(deps): bump test-summary/action from 2.1 to 2.2 (testcontainers#2058)
  chore(deps): bump actions/setup-go from 4 to 5 (testcontainers#2057)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants