Skip to content

Commit 515be48

Browse files
committed
Merge remote-tracking branch 'upstream/release-1.12'
Signed-off-by: ItalyPaleAle <[email protected]>
2 parents 1208b3e + 5384d54 commit 515be48

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

pubsub/gcp/pubsub/pubsub.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ func (g *GCPPubSub) getPubSubClient(ctx context.Context, metadata *metadata) (*g
124124
var pubsubClient *gcppubsub.Client
125125
var err error
126126

127+
// context.Background is used here, as the context used to Dial the
128+
// server in the gRPC DialPool. Callers should always call `Close` on the
129+
// component to ensure all resources are released.
127130
if metadata.PrivateKeyID != "" {
128131
// TODO: validate that all auth json fields are filled
129132
authJSON := &GCPAuthJSON{
@@ -141,7 +144,7 @@ func (g *GCPPubSub) getPubSubClient(ctx context.Context, metadata *metadata) (*g
141144
gcpCompatibleJSON, _ := json.Marshal(authJSON)
142145
g.logger.Debugf("Using explicit credentials for GCP")
143146
clientOptions := option.WithCredentialsJSON(gcpCompatibleJSON)
144-
pubsubClient, err = gcppubsub.NewClient(ctx, metadata.ProjectID, clientOptions)
147+
pubsubClient, err = gcppubsub.NewClient(context.Background(), metadata.ProjectID, clientOptions)
145148
if err != nil {
146149
return pubsubClient, err
147150
}
@@ -156,7 +159,7 @@ func (g *GCPPubSub) getPubSubClient(ctx context.Context, metadata *metadata) (*g
156159
g.logger.Debugf("setting GCP PubSub Emulator environment variable to 'PUBSUB_EMULATOR_HOST=%s'", metadata.ConnectionEndpoint)
157160
os.Setenv("PUBSUB_EMULATOR_HOST", metadata.ConnectionEndpoint)
158161
}
159-
pubsubClient, err = gcppubsub.NewClient(ctx, metadata.ProjectID)
162+
pubsubClient, err = gcppubsub.NewClient(context.Background(), metadata.ProjectID)
160163
if err != nil {
161164
return pubsubClient, err
162165
}

state/gcp/firestore/firestore.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,21 @@ func getFirestoreMetadata(meta state.Metadata) (*firestoreMetadata, error) {
211211
return &m, nil
212212
}
213213

214+
func (f *Firestore) Close() error {
215+
if f.client != nil {
216+
return f.client.Close()
217+
}
218+
219+
return nil
220+
}
221+
214222
func getGCPClient(ctx context.Context, metadata *firestoreMetadata, l logger.Logger) (*datastore.Client, error) {
215223
var gcpClient *datastore.Client
216224
var err error
217225

226+
// context.Background is used here, as the context used to Dial the
227+
// server in the gRPC DialPool. Callers should always call `Close` on the
228+
// component to ensure all resources are released.
218229
if metadata.PrivateKeyID != "" {
219230
var b []byte
220231
b, err = json.Marshal(metadata)
@@ -223,7 +234,7 @@ func getGCPClient(ctx context.Context, metadata *firestoreMetadata, l logger.Log
223234
}
224235

225236
opt := option.WithCredentialsJSON(b)
226-
gcpClient, err = datastore.NewClient(ctx, metadata.ProjectID, opt)
237+
gcpClient, err = datastore.NewClient(context.Background(), metadata.ProjectID, opt)
227238
if err != nil {
228239
return nil, err
229240
}
@@ -238,7 +249,7 @@ func getGCPClient(ctx context.Context, metadata *firestoreMetadata, l logger.Log
238249
l.Debugf("setting GCP Datastore Emulator environment variable to 'DATASTORE_EMULATOR_HOST=%s'", metadata.ConnectionEndpoint)
239250
os.Setenv("DATASTORE_EMULATOR_HOST", metadata.ConnectionEndpoint)
240251
}
241-
gcpClient, err = datastore.NewClient(ctx, metadata.ProjectID)
252+
gcpClient, err = datastore.NewClient(context.Background(), metadata.ProjectID)
242253
if err != nil {
243254
return nil, err
244255
}

tests/certification/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ require (
1616
github.com/cenkalti/backoff/v4 v4.2.1
1717
github.com/cloudwego/kitex v0.5.0
1818
github.com/cloudwego/kitex-examples v0.1.1
19-
github.com/dapr/components-contrib v1.12.0-rc.1
20-
github.com/dapr/dapr v1.12.0-rc.1
19+
github.com/dapr/components-contrib v1.12.0-rc.3
20+
github.com/dapr/dapr v1.12.0-rc.5
2121
github.com/dapr/go-sdk v1.8.0
2222
github.com/dapr/kit v0.12.1
2323
github.com/eclipse/paho.mqtt.golang v1.4.3
@@ -64,7 +64,7 @@ require (
6464
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 // indirect
6565
github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue v1.0.0 // indirect
6666
github.com/Azure/go-amqp v1.0.2 // indirect
67-
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect
67+
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 // indirect
6868
github.com/DataDog/zstd v1.5.2 // indirect
6969
github.com/PuerkitoBio/purell v1.2.0 // indirect
7070
github.com/RoaringBitmap/roaring v1.1.0 // indirect

tests/certification/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue v1.0.0 h1:lJwNFV+xYjHREUTH
9090
github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue v1.0.0/go.mod h1:GfT0aGew8Qj5yiQVqOO5v7N8fanbJGyUoHqXg56qcVY=
9191
github.com/Azure/go-amqp v1.0.2 h1:zHCHId+kKC7fO8IkwyZJnWMvtRXhYC0VJtD0GYkHc6M=
9292
github.com/Azure/go-amqp v1.0.2/go.mod h1:vZAogwdrkbyK3Mla8m/CxSc/aKdnTZ4IbPxl51Y5WZE=
93-
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk=
94-
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
93+
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 h1:hVeq+yCyUi+MsoO/CU95yqCIcdzra5ovzk8Q2BBpV2M=
94+
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
9595
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
9696
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
9797
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
@@ -332,8 +332,8 @@ github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53E
332332
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
333333
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
334334
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
335-
github.com/dapr/dapr v1.12.0-rc.1 h1:JbWJiyG0XqBWCIqQ+RtkXORQpagnHj/ScdU+6gG2LJc=
336-
github.com/dapr/dapr v1.12.0-rc.1/go.mod h1:SZWyKAug5WNBXYtQ8dimbJkJuu8nrq4/hRElHmBvYLY=
335+
github.com/dapr/dapr v1.12.0-rc.5 h1:I9mEA8S+fd1hXHPzpo+kkAVyN7TfoDajSXuysU9R550=
336+
github.com/dapr/dapr v1.12.0-rc.5/go.mod h1:17xGNqDCPLLO2TNIc9gbPYUZKWFyIv6WKklSn/k5XOY=
337337
github.com/dapr/go-sdk v1.8.0 h1:OEleeL3zUTqXxIZ7Vkk3PClAeCh1g8sZ1yR2JFZKfXM=
338338
github.com/dapr/go-sdk v1.8.0/go.mod h1:MBcTKXg8PmBc8A968tVWQg1Xt+DZtmeVR6zVVVGcmeA=
339339
github.com/dapr/kit v0.12.1 h1:XT0CJQQaKRYSzIzZo15O1PAHGUrMGoAavdFRcNVZ+UE=

0 commit comments

Comments
 (0)