From 69d8991c240d8ee051f788f4fd664260e2fa4422 Mon Sep 17 00:00:00 2001 From: Matt Siwiec Date: Mon, 23 Oct 2023 09:27:44 -0600 Subject: [PATCH] prefix with events Signed-off-by: Matt Siwiec --- chart/loadbalancer-provider-haproxy/templates/config.yaml | 2 +- chart/loadbalancer-provider-haproxy/values.yaml | 2 +- cmd/process.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chart/loadbalancer-provider-haproxy/templates/config.yaml b/chart/loadbalancer-provider-haproxy/templates/config.yaml index 56e300c..203b229 100644 --- a/chart/loadbalancer-provider-haproxy/templates/config.yaml +++ b/chart/loadbalancer-provider-haproxy/templates/config.yaml @@ -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 }}" @@ -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 }}" diff --git a/chart/loadbalancer-provider-haproxy/values.yaml b/chart/loadbalancer-provider-haproxy/values.yaml index b1bc5a1..e445e77 100644 --- a/chart/loadbalancer-provider-haproxy/values.yaml +++ b/chart/loadbalancer-provider-haproxy/values.yaml @@ -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 diff --git a/cmd/process.go b/cmd/process.go index 50cd935..83eb4c2 100644 --- a/cmd/process.go +++ b/cmd/process.go @@ -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()) @@ -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