Skip to content
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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.2.2

- name: Install Helm
uses: azure/setup-helm@v4.3.0

- name: Lint chart
run: helm lint . --set collector.env.COLLECTOR_SECRET=test123

- name: Test template with COLLECTOR_SECRET
run: helm template test . --set collector.env.COLLECTOR_SECRET=test123

- name: Test template with envFrom
run: helm template test . --set-json 'collector.envFrom=[{"secretRef":{"name":"my-secret"}}]'

- name: Test validation fails without secret
run: |
if helm template test . 2>&1; then
echo "Expected validation to fail but it passed"
exit 1
fi
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: collector
description: A Helm chart for Better Stack Collector - monitoring solution that collects metrics, logs, and traces
type: application
version: 0.1.32
version: 0.1.33
appVersion: "latest"
keywords:
- monitoring
Expand Down
4 changes: 2 additions & 2 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Create the name of the service account to use
Validate required values
*/}}
{{- define "better-stack-collector.validateValues" -}}
{{- if not (or .Values.collector.env.COLLECTOR_SECRET (gt (len .Values.collector.envFrom.secretRefs) 0)) }}
{{- fail "COLLECTOR_SECRET is required. Please provide your Better Stack collector secret either via collector.env.COLLECTOR_SECRET or through collector.envFrom.secretRefs. Find your collector secret here: https://telemetry.betterstack.com/team/0/collectors." }}
{{- if not (or .Values.collector.env.COLLECTOR_SECRET (gt (len .Values.collector.envFrom) 0)) }}
{{- fail "COLLECTOR_SECRET is required. Please provide your Better Stack collector secret either via collector.env.COLLECTOR_SECRET or through collector.envFrom (standard Kubernetes envFrom format). Find your collector secret here: https://telemetry.betterstack.com/team/0/collectors." }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ collector:

# Environment variables
env:
COLLECTOR_SECRET: "" # Required: Your collector secret (leave empty if you set it via envFrom.secretRefs)
COLLECTOR_SECRET: "" # Required: Your collector secret (leave empty if using envFrom)
BASE_URL: "https://telemetry.betterstack.com"
CLUSTER_COLLECTOR: ""
VECTOR_LOG_FORMAT: "json"
Expand Down