You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(gcloud): deprecate old gcp containers, creating subpackages for them (#3063)
* chore: migrate BigQuery to its own package
* chore: migrate BigTable to its own package
* chore: migrate Datastore to its own package
* chore: migrate Firestore to its own package
* chore: migrate Pubsub to its own package
* chore: migrate Spanner to its own package
* chore: use shared options
* docs: fix relateive path to include
* chore: fix deprecation chain
{% include "../features/common_functional_options.md" %}
2
+
3
+
#### WithProjectID
4
+
5
+
- Not available until the next release of testcontainers-go <ahref="https://github.com/testcontainers/testcontainers-go"><spanclass="tc-version">:material-tag: main</span></a>
6
+
7
+
The `WithProjectID` function sets the project ID for the Google Cloud container.
By default, the all the emulators use `gcr.io/google.com/cloudsdktool/cloud-sdk:367.0.0-emulators` as the default Docker image, except for the BigQuery emulator, which uses `ghcr.io/goccy/bigquery-emulator:0.6.1`, and Spanner, which uses `gcr.io/cloud-spanner-emulator/emulator:1.4.0`.
21
29
22
-
###BigQuery
30
+
## BigQuery
23
31
24
-
<!--codeinclude-->
25
-
[Creating a BigQuery container](../../modules/gcloud/bigquery_test.go) inside_block:runBigQueryContainer
26
-
[Obtaining a BigQuery client](../../modules/gcloud/bigquery_test.go) inside_block:bigQueryClient
27
-
<!--/codeinclude-->
32
+
### Run function
28
33
29
-
It's important to set the `option.WithEndpoint()` option using the container's URI, as shown in the client example above.
34
+
- Not available until the next release of testcontainers-go <ahref="https://github.com/testcontainers/testcontainers-go"><spanclass="tc-version">:material-tag: main</span></a>
35
+
36
+
The BigQuery module exposes one entrypoint function to create the BigQuery container, and this function receives three parameters:
- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
34
60
35
61
If you would like to do additional initialization in the BigQuery container, add a `data.yaml` file represented by an `io.Reader` to the container request with the `WithDataYAML` function.
36
62
That file is copied after the container is created but before it's started. The startup command then used will look like `--project test --data-from-yaml /testcontainers-data.yaml`.
37
63
38
64
An example of a `data.yaml` file that seeds the BigQuery instance with datasets and tables is shown below:
This feature is only available for the `BigQuery` container, and if you pass multiple `WithDataYAML` options, an error is returned.
70
+
### Examples
71
+
72
+
<!--codeinclude-->
73
+
[Creating a BigQuery container](../../modules/gcloud/bigquery/examples_test.go) inside_block:runBigQueryContainer
74
+
[Obtaining a BigQuery client](../../modules/gcloud/bigquery/examples_test.go) inside_block:bigQueryClient
75
+
<!--/codeinclude-->
76
+
77
+
It's important to set the `option.WithEndpoint()` option using the container's URI, as shown in the client example above.
78
+
79
+
## BigTable
80
+
81
+
### Run function
82
+
83
+
- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
84
+
85
+
The BigTable module exposes one entrypoint function to create the BigTable container, and this function receives three parameters:
- `testcontainers.ContainerCustomizer`, a variadic argument for passing options.
94
+
95
+
### Container Options
96
+
97
+
When starting the BigTable container, you can pass options in a variadic way to configure it.
98
+
99
+
#### Image
46
100
47
-
### BigTable
101
+
Use the second argument in the `Run` function to set a valid Docker image.
102
+
In example: `Run(context.Background(), "gcr.io/google.com/cloudsdktool/cloud-sdk:367.0.0-emulators")`.
103
+
104
+
{% include "./gcloud-shared.md" %}
105
+
106
+
### Examples
48
107
49
108
<!--codeinclude-->
50
-
[Creating a BigTable container](../../modules/gcloud/bigtable_test.go) inside_block:runBigTableContainer
51
-
[Obtaining a BigTable Admin client](../../modules/gcloud/bigtable_test.go) inside_block:bigTableAdminClient
52
-
[Obtaining a BigTable client](../../modules/gcloud/bigtable_test.go) inside_block:bigTableClient
109
+
[Creating a BigTable container](../../modules/gcloud/bigtable/examples_test.go) inside_block:runBigTableContainer
110
+
[Obtaining a BigTable Admin client](../../modules/gcloud/bigtable/examples_test.go) inside_block:bigTableAdminClient
111
+
[Obtaining a BigTable client](../../modules/gcloud/bigtable/examples_test.go) inside_block:bigTableClient
53
112
<!--/codeinclude-->
54
113
55
114
It's important to set the `option.WithEndpoint()` option using the container's URI, as shown in the Admin client example above.
56
115
57
-
### Datastore
116
+
## Datastore
117
+
118
+
### Run function
119
+
120
+
- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
121
+
122
+
The Datastore module exposes one entrypoint function to create the Datastore container, and this function receives three parameters:
- `testcontainers.ContainerCustomizer`, a variadic argument for passing options.
131
+
132
+
### Container Options
133
+
134
+
When starting the Datastore container, you can pass options in a variadic way to configure it.
135
+
136
+
#### Image
137
+
138
+
Use the second argument in the `Run` function to set a valid Docker image.
139
+
In example: `Run(context.Background(), "gcr.io/google.com/cloudsdktool/cloud-sdk:367.0.0-emulators")`.
140
+
141
+
{% include "./gcloud-shared.md" %}
142
+
143
+
### Examples
58
144
59
145
<!--codeinclude-->
60
-
[Creating a Datastore container](../../modules/gcloud/datastore_test.go) inside_block:runDatastoreContainer
61
-
[Obtaining a Datastore client](../../modules/gcloud/datastore_test.go) inside_block:datastoreClient
146
+
[Creating a Datastore container](../../modules/gcloud/datastore/examples_test.go) inside_block:runDatastoreContainer
147
+
[Obtaining a Datastore client](../../modules/gcloud/datastore/examples_test.go) inside_block:datastoreClient
62
148
<!--/codeinclude-->
63
149
64
150
It's important to set the `option.WithEndpoint()` option using the container's URI, as shown in the client example above.
65
151
66
-
###Firestore
152
+
## Firestore
67
153
68
-
<!--codeinclude-->
69
-
[Creating a Firestore container](../../modules/gcloud/firestore_test.go) inside_block:runFirestoreContainer
70
-
[Obtaining a Firestore client](../../modules/gcloud/firestore_test.go) inside_block:firestoreClient
71
-
<!--/codeinclude-->
154
+
### Run function
72
155
73
-
It's important to set the target string of the `grpc.NewClient` method using the container's URI, as shown in the client example above.
156
+
- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
157
+
158
+
The Firestore module exposes one entrypoint function to create the Firestore container, and this function receives three parameters:
- `testcontainers.ContainerCustomizer`, a variadic argument for passing options.
167
+
168
+
### Container Options
169
+
170
+
When starting the Firestore container, you can pass options in a variadic way to configure it.
171
+
172
+
#### Image
173
+
174
+
Use the second argument in the `Run` function to set a valid Docker image.
175
+
In example: `Run(context.Background(), "gcr.io/google.com/cloudsdktool/cloud-sdk:367.0.0-emulators")`.
176
+
177
+
{% include "./gcloud-shared.md" %}
74
178
75
-
### Pubsub
179
+
### Examples
76
180
77
181
<!--codeinclude-->
78
-
[Creating a Pubsub container](../../modules/gcloud/pubsub_test.go) inside_block:runPubsubContainer
79
-
[Obtaining a Pubsub client](../../modules/gcloud/pubsub_test.go) inside_block:pubsubClient
182
+
[Creating a Firestore container](../../modules/gcloud/firestore/examples_test.go) inside_block:runFirestoreContainer
183
+
[Obtaining a Firestore client](../../modules/gcloud/firestore/examples_test.go) inside_block:firestoreClient
80
184
<!--/codeinclude-->
81
185
82
186
It's important to set the target string of the `grpc.NewClient` method using the container's URI, as shown in the client example above.
83
187
84
-
### Spanner
188
+
## Pubsub
189
+
190
+
### Run function
191
+
192
+
- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
193
+
194
+
The Pubsub module exposes one entrypoint function to create the Pubsub container, and this function receives three parameters:
- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
99
229
100
-
!!!info
101
-
The `RunXXXContainer(ctx, opts...)` functions are deprecated and will be removed in the next major release of _Testcontainers for Go_.
102
-
103
-
The GCloud module exposes one entrypoint function to create the different GCloud emulators, and each function receives three parameters:
230
+
The Spanner module exposes one entrypoint function to create the Spanner container, and this function receives three parameters:
0 commit comments