Skip to content
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

Add Settable ID for NATS Context Options #205

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion surveyor/conn_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ type natsContext struct {
TLSKey string `json:"tls_key"`

// only passed programmatically
NatsOpts []nats.Option `json:"-"`
NatsOptsID string `json:"nats_opts_id"`
NatsOpts []nats.Option `json:"-"`
}

func (c *natsContext) copy() *natsContext {
Expand Down
3 changes: 3 additions & 0 deletions surveyor/jetstream_advisories.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ type JSAdvisoryConfig struct {
// optional configuration for importing JS metrics and advisories from other accounts
ExternalAccountConfig *JSAdvisoriesExternalAccountConfig `json:"-"`

// unique identifier for set of NATS options, to permit reload on change
NatsOptsID string `json:"nats_opts_id"`
// nats options appended to base surveyor options
NatsOpts []nats.Option `json:"-"`
}
Expand Down Expand Up @@ -391,6 +393,7 @@ func (o *jsAdvisoryListener) natsContext() *natsContext {
TLSCA: o.config.TLSCA,
TLSCert: o.config.TLSCert,
TLSKey: o.config.TLSKey,
NatsOptsID: o.config.NatsOptsID,
NatsOpts: o.config.NatsOpts,
}

Expand Down
3 changes: 3 additions & 0 deletions surveyor/observation.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ type ServiceObsConfig struct {
// optional configuration for importing observations from other accounts
ExternalAccountConfig *ServiceObservationExternalAccountConfig `json:"-"`

// unique identifier for set of NATS options, to permit reload on change
NatsOptsID string `json:"nats_opts_id"`
// nats options appended to base surveyor options
NatsOpts []nats.Option `json:"-"`
}
Expand Down Expand Up @@ -266,6 +268,7 @@ func (o *serviceObsListener) natsContext() *natsContext {
TLSCA: o.config.TLSCA,
TLSCert: o.config.TLSCert,
TLSKey: o.config.TLSKey,
NatsOptsID: o.config.NatsOptsID,
NatsOpts: o.config.NatsOpts,
}

Expand Down