Skip to content

Commit 0424d3f

Browse files
authored
fix(pulsar): ensure auth data is updated during function/connector updates (#178)
* build(deps): upgrade pulsar-client-go to v0.18.0-candidate-1 * fix(pulsar): ensure auth data is updated during resource updates * test(pulsar): update topic config test values
1 parent 00c4985 commit 0424d3f

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/streamnative/terraform-provider-pulsar
33
go 1.24.4
44

55
require (
6-
github.com/apache/pulsar-client-go v0.15.2-0.20250710023731-c587b5cefb04
6+
github.com/apache/pulsar-client-go v0.18.0-candidate-1.0.20251217021558-9d65d0ecf43f
77
github.com/cenkalti/backoff/v4 v4.2.1
88
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
99
github.com/hashicorp/go-multierror v1.1.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXva
1818
github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
1919
github.com/apache/pulsar-client-go v0.15.2-0.20250710023731-c587b5cefb04 h1:3BoszOdT9uueXXsqzZiYgrlc7B1+R0lEjGlJADwl+KU=
2020
github.com/apache/pulsar-client-go v0.15.2-0.20250710023731-c587b5cefb04/go.mod h1:ow9PhLoGUY6ncrKOtjnWeJycFnTKOwrIV39j3kNV54M=
21+
github.com/apache/pulsar-client-go v0.18.0-candidate-1.0.20251217021558-9d65d0ecf43f h1:L2zBKmcYD/qyko07XLxVYg97kXVqN+SMI/ZySf0m7+A=
22+
github.com/apache/pulsar-client-go v0.18.0-candidate-1.0.20251217021558-9d65d0ecf43f/go.mod h1:GKmTD1u5YLuhUnoVTNGdhdGNAYhoglWNWgwLJZTljAw=
2123
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
2224
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
2325
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=

pulsar/resource_pulsar_function.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,9 @@ func resourcePulsarFunctionUpdate(ctx context.Context, d *schema.ResourceData, m
545545
archive = *functionConfig.Go
546546
}
547547

548-
updateOptions := utils.NewUpdateOptions()
548+
updateOptions := &utils.UpdateOptions{
549+
UpdateAuthData: true,
550+
}
549551
if isPackageURLSupported(archive) {
550552
err = client.UpdateFunctionWithURL(functionConfig, archive, updateOptions)
551553
} else {

pulsar/resource_pulsar_sink.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,9 @@ func resourcePulsarSinkUpdate(ctx context.Context, d *schema.ResourceData, meta
606606
return diag.FromErr(err)
607607
}
608608

609-
updateOptions := utils.NewUpdateOptions()
609+
updateOptions := &utils.UpdateOptions{
610+
UpdateAuthData: true,
611+
}
610612
if isPackageURLSupported(sinkConfig.Archive) {
611613
err = client.UpdateSinkWithURL(sinkConfig, sinkConfig.Archive, updateOptions)
612614
} else {

pulsar/resource_pulsar_source.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,9 @@ func resourcePulsarSourceUpdate(ctx context.Context, d *schema.ResourceData, met
535535
return diag.FromErr(err)
536536
}
537537

538-
updateOptions := utils.NewUpdateOptions()
538+
updateOptions := &utils.UpdateOptions{
539+
UpdateAuthData: true,
540+
}
539541
if isPackageURLSupported(sourceConfig.Archive) {
540542
err = client.UpdateSourceWithURL(sourceConfig, sourceConfig.Archive, updateOptions)
541543
} else {

pulsar/resource_pulsar_topic_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ func TestTopicWithTopicConfigUpdate(t *testing.T) {
253253
Check: resource.ComposeTestCheckFunc(
254254
testPulsarTopicExists(resourceName, t),
255255
resource.TestCheckResourceAttr(resourceName, "topic_config.#", "1"),
256-
resource.TestCheckResourceAttr(resourceName, "topic_config.0.max_consumers", "0"),
257-
resource.TestCheckResourceAttr(resourceName, "topic_config.0.max_producers", "0"),
258-
resource.TestCheckResourceAttr(resourceName, "topic_config.0.message_ttl_seconds", "0"),
256+
resource.TestCheckResourceAttr(resourceName, "topic_config.0.max_consumers", "-1"),
257+
resource.TestCheckResourceAttr(resourceName, "topic_config.0.max_producers", "-1"),
258+
resource.TestCheckResourceAttr(resourceName, "topic_config.0.message_ttl_seconds", "-1"),
259259
),
260260
},
261261
{

0 commit comments

Comments
 (0)