Skip to content

Commit

Permalink
prefix with events
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Siwiec <rizzza@users.noreply.github.com>
  • Loading branch information
rizzza committed Oct 23, 2023
1 parent 014bf04 commit 69d8991
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chart/loadbalancer-provider-haproxy/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
labels:
{{- include "common.labels.standard" . | nindent 4 }}
data:
LOADBALANCERPROVIDERHAPROXY_EVENTS_MAX_MSG_PROCESS_ATTEMPTS: "{{ .Values.provider.events.maxMsgProcessAttempts }}"
LOADBALANCERPROVIDERHAPROXY_EVENTS_NATS_SUBSCRIBEPREFIX: "{{ .Values.provider.events.topicPrefix }}"
LOADBALANCERPROVIDERHAPROXY_EVENTS_NATS_PUBLISHPREFIX: "{{ .Values.provider.events.topicPrefix }}"
LOADBALANCERPROVIDERHAPROXY_EVENTS_NATS_URL: "{{ .Values.provider.events.connectionURL }}"
Expand All @@ -13,7 +14,6 @@ data:
LOADBALANCERPROVIDERHAPROXY_IPAM_ENDPOINT: "{{ .Values.provider.ipam.endpoint }}"
LOADBALANCERPROVIDERHAPROXY_IPBLOCK: "{{ .Values.provider.ipBlock }}"
LOADBALANCERPROVIDERHAPROXY_OIDC_CLIENT_ISSUER: "{{ .Values.provider.api.oidc.client.issuer }}"
LOADBALANCERPROVIDERHAPROXY_MAX_MSG_PROCESS_ATTEMPTS: "{{ .Values.provider.events.maxMsgProcessAttempts }}"
{{- if .Values.provider.tracing.enabled }}
LOADBALANCERPROVIDERHAPROXY_TRACING_ENABLED: "{{ .Values.provider.tracing.enabled }}"
LOADBALANCERPROVIDERHAPROXY_TRACING_PROVIDER: "{{ .Values.provider.tracing.provider }}"
Expand Down
2 changes: 1 addition & 1 deletion chart/loadbalancer-provider-haproxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ provider:
- "*.load-balancer"
- "events.create.port"
location: ""
# amount of times to retry a failed message before discarding it
# amount of times to retry a failed message before discarding it. 0 means msg will always be nacked on failure to process
maxMsgProcessAttempts: 0
tracing:
# enabled is true if OpenTelemetry tracing should be enabled for load-balancer-operator
Expand Down
8 changes: 4 additions & 4 deletions cmd/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ func init() {
processCmd.PersistentFlags().StringSlice("event-locations", nil, "location id(s) to filter events for")
viperx.MustBindFlag(viper.GetViper(), "event-locations", processCmd.PersistentFlags().Lookup("event-locations"))

processCmd.PersistentFlags().Uint64("events-max-msg-process-attempts", 0, "maxiumum number of attempts at processing an event message")
viperx.MustBindFlag(viper.GetViper(), "events.maxMsgProcessAttempts", processCmd.PersistentFlags().Lookup("events-max-msg-process-attempts"))

processCmd.PersistentFlags().StringSlice("change-topics", nil, "change topics to subscribe to")
viperx.MustBindFlag(viper.GetViper(), "change-topics", processCmd.PersistentFlags().Lookup("change-topics"))

processCmd.PersistentFlags().String("ipblock", "", "ip block id to use for requesting load balancer IPs")
viperx.MustBindFlag(viper.GetViper(), "ipblock", processCmd.PersistentFlags().Lookup("ipblock"))

processCmd.PersistentFlags().Uint64("max-msg-process-attempts", 0, "maxiumum number of attempts at processing an event message")
viperx.MustBindFlag(viper.GetViper(), "max-msg-process-attempts", processCmd.PersistentFlags().Lookup("max-msg-process-attempts"))

events.MustViperFlags(viper.GetViper(), processCmd.Flags(), appName)
oauth2x.MustViperFlags(viper.GetViper(), processCmd.Flags())
otelx.MustViperFlags(viper.GetViper(), processCmd.Flags())
Expand Down Expand Up @@ -98,7 +98,7 @@ func process(ctx context.Context, logger *zap.SugaredLogger) error {
EventsConnection: conn,
ChangeTopics: viper.GetStringSlice("change-topics"),
IPBlock: viper.GetString("ipblock"),
MaxProcessMsgAttempts: viper.GetUint64("max-msg-process-attempts"),
MaxProcessMsgAttempts: viper.GetUint64("events-max-msg-process-attempts"),
}

// init lbapi client and ipam client
Expand Down

0 comments on commit 69d8991

Please sign in to comment.