From ef9273fec5604c905801722b563c9f9b5ee922d7 Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Tue, 22 Aug 2023 08:14:09 -0400 Subject: [PATCH] Fix function creation for Pulsar < 3.0 Removing `omitempty` from skipToLatest bool causes versions pre-3.0 versions of pulsar to barf from the unexpected key, even if the value is false. Restoring it allows them to keep working if the value is false. --- function_confg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/function_confg.go b/function_confg.go index 55669d5..070716a 100644 --- a/function_confg.go +++ b/function_confg.go @@ -87,6 +87,6 @@ type FunctionConfig struct { MaxPendingAsyncRequests int `json:"maxPendingAsyncRequests,omitempty" yaml:"maxPendingAsyncRequests"` //nolint ExposePulsarAdminClientEnabled bool `json:"exposePulsarAdminClientEnabled" yaml:"exposePulsarAdminClientEnabled"` - SkipToLatest bool `json:"skipToLatest" yaml:"skipToLatest"` + SkipToLatest bool `json:"skipToLatest,omitempty" yaml:"skipToLatest"` SubscriptionPosition string `json:"subscriptionPosition,omitempty" yaml:"subscriptionPosition"` }