-
Notifications
You must be signed in to change notification settings - Fork 747
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: if key/value store already exists use that #2293
Conversation
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
@@ -55,12 +55,22 @@ func (stream *SensorJetstream) Initialize() error { | |||
} | |||
// create Key/Value store for this Sensor (seems to be okay to call this if it already exists) | |||
stream.keyValueStore, err = stream.MgmtConnection.JSContext.CreateKeyValue(&nats.KeyValueConfig{Bucket: stream.sensorName}) | |||
if err != nil { | |||
switch err { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we query first, if it's not existing, then create it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com> Signed-off-by: Bilal Bakht Ahmad <tringingly@gmail.com>
Fixes #2278
Use the existing key/value store if it already exists.
I tested this with the following experiments involving a webhook and a sensor with a trigger that is configured as "A&&B":
kubectl apply
it, send "B", verify trigger occursSigned-off-by: Julie Vogelman julie_vogelman@intuit.com