From f6c26c02b1550cc9cf40fe57ee66a134f09e2df2 Mon Sep 17 00:00:00 2001 From: Malar Invention Date: Wed, 18 Jun 2025 20:54:03 +0530 Subject: [PATCH 1/2] feat: Add GitHub Actions CI workflow Configure automated checks for pull requests including: - Linting the Helm chart. - Building the exporter Docker image. - A placeholder for future tests. --- .github/workflows/ci.yaml | 57 +++++++++++++++++++ .../templates/exporter-deployment.yaml | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..40755e4 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,57 @@ +name: CI + +on: + pull_request: + branches: ["main"] # Or your main development branch + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + validate-chart: + name: Validate Helm Chart + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.10.0 + + - name: Helm Lint + run: helm lint ./charts/iperf3-monitor + + build: + name: Build Docker Image + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build Docker image + uses: docker/build-push-action@v4 + with: + context: ./exporter + push: false # Do not push on PRs + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + test: + name: Run Tests + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + # Replace this step with your actual test command(s) + - name: Placeholder Test Step + run: echo "No tests configured yet. Add your test commands here." diff --git a/charts/iperf3-monitor/templates/exporter-deployment.yaml b/charts/iperf3-monitor/templates/exporter-deployment.yaml index 1188f68..6c523bd 100644 --- a/charts/iperf3-monitor/templates/exporter-deployment.yaml +++ b/charts/iperf3-monitor/templates/exporter-deployment.yaml @@ -41,7 +41,7 @@ spec: fieldRef: fieldPath: metadata.namespace - name: IPERF_SERVER_LABEL_SELECTOR - value: "app.kubernetes.io/name={{ include \"iperf3-monitor.name\" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=server" + value: 'app.kubernetes.io/name={{ include \"iperf3-monitor.name\" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=server' {{- with .Values.exporter.resources }} resources: {{- toYaml . | nindent 10 }} From fec4cf64b993eb341dbcda8b84b45bb69b6ecd45 Mon Sep 17 00:00:00 2001 From: Malar Invention Date: Thu, 19 Jun 2025 10:08:59 +0530 Subject: [PATCH 2/2] fix: Remove unnecessary dependency section from Chart.yaml and correct formatting in exporter-deployment.yaml --- charts/iperf3-monitor/templates/exporter-deployment.yaml | 3 ++- charts/iperf3-monitor/templates/server-daemonset.yaml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/iperf3-monitor/templates/exporter-deployment.yaml b/charts/iperf3-monitor/templates/exporter-deployment.yaml index 6c523bd..943aa45 100644 --- a/charts/iperf3-monitor/templates/exporter-deployment.yaml +++ b/charts/iperf3-monitor/templates/exporter-deployment.yaml @@ -41,8 +41,9 @@ spec: fieldRef: fieldPath: metadata.namespace - name: IPERF_SERVER_LABEL_SELECTOR - value: 'app.kubernetes.io/name={{ include \"iperf3-monitor.name\" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=server' + value: "app.kubernetes.io/name={{ include \"iperf3-monitor.name\" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=server" {{- with .Values.exporter.resources }} resources: {{- toYaml . | nindent 10 }} {{- end }} +``` \ No newline at end of file diff --git a/charts/iperf3-monitor/templates/server-daemonset.yaml b/charts/iperf3-monitor/templates/server-daemonset.yaml index d8495e3..9523270 100644 --- a/charts/iperf3-monitor/templates/server-daemonset.yaml +++ b/charts/iperf3-monitor/templates/server-daemonset.yaml @@ -42,3 +42,4 @@ spec: resources: {{- toYaml . | nindent 12 }} {{- end }} +``` \ No newline at end of file