Skip to content

Commit 6447dd5

Browse files
committed
Remove maxRetries configuration from CLI and Helm values, setting a default of 15 retries for log send failures.
1 parent f1e6de3 commit 6447dd5

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

helm/templates/service.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ spec:
120120
- name: SSL_CERT_DIR
121121
value: {{ .Values.image.sslCertDir }}
122122
{{- end }}
123-
{{- if .Values.maxRetries }}
124-
- name: CODER_MAX_RETRIES
125-
value: "{{ .Values.maxRetries }}"
126-
{{- end }}
127123
{{- with .Values.securityContext }}
128124
securityContext:
129125
{{- toYaml . | nindent 12 }}

helm/values.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ url: ""
55
# If unspecified or empty it will watch all namespaces.
66
namespaces: []
77

8-
# maxRetries -- Maximum retry attempts for failed log sends (logs are discarded after this limit)
9-
maxRetries: 10
10-
118
# volumes -- A list of extra volumes to add to the coder-logstream pod.
129
volumes:
1310
# emptyDir: {}

main.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"net/url"
77
"os"
8-
"strconv"
98
"strings"
109

1110
"cdr.dev/slog"
@@ -31,7 +30,6 @@ func root() *cobra.Command {
3130
kubeConfig string
3231
namespacesStr string
3332
labelSelector string
34-
maxRetriesStr string
3533
)
3634
cmd := &cobra.Command{
3735
Use: "coder-logstream-kube",
@@ -74,19 +72,14 @@ func root() *cobra.Command {
7472
}
7573
}
7674

77-
maxRetries, err := strconv.Atoi(maxRetriesStr)
78-
if err != nil {
79-
return fmt.Errorf("parse max retries: %w", err)
80-
}
81-
8275
reporter, err := newPodEventLogger(cmd.Context(), podEventLoggerOptions{
8376
coderURL: parsedURL,
8477
client: client,
8578
namespaces: namespaces,
8679
fieldSelector: fieldSelector,
8780
labelSelector: labelSelector,
8881
logger: slog.Make(sloghuman.Sink(cmd.ErrOrStderr())).Leveled(slog.LevelDebug),
89-
maxRetries: maxRetries,
82+
maxRetries: 15, // 15 retries is the default max retries for a log send failure.
9083
})
9184
if err != nil {
9285
return fmt.Errorf("create pod event reporter: %w", err)
@@ -105,7 +98,6 @@ func root() *cobra.Command {
10598
cmd.Flags().StringVarP(&namespacesStr, "namespaces", "n", os.Getenv("CODER_NAMESPACES"), "List of namespaces to use when listing pods")
10699
cmd.Flags().StringVarP(&fieldSelector, "field-selector", "f", "", "Field selector to use when listing pods")
107100
cmd.Flags().StringVarP(&labelSelector, "label-selector", "l", "", "Label selector to use when listing pods")
108-
cmd.Flags().StringVarP(&maxRetriesStr, "max-retries", "m", os.Getenv("CODER_MAX_RETRIES"), "Maximum retry attempts for failed log sends (logs are discarded after this limit)")
109101

110102
return cmd
111103
}

0 commit comments

Comments
 (0)