diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 38251e6..3cde71c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,12 +42,21 @@ jobs: uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + # Tag with the PR number if it's a pull request event + type=match,pattern=pull_request,value=pr-{{number}} + # Tag with the git SHA + type=sha,prefix= + # Tag with 'latest' if on the main branch (though this workflow only runs on PRs to main) + type=ref,event=branch,pattern=main,value=latest - name: Build Docker image uses: docker/build-push-action@v4 with: context: ./exporter - push: false # Do not push on PRs + # Push the image if the event is a pull request. + # The workflow currently only triggers on pull_request events. + push: ${{ github.event_name == 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 diff --git a/charts/iperf3-monitor/templates/exporter-deployment.yaml b/charts/iperf3-monitor/templates/exporter-deployment.yaml index b6d4df3..e58bd7b 100644 --- a/charts/iperf3-monitor/templates/exporter-deployment.yaml +++ b/charts/iperf3-monitor/templates/exporter-deployment.yaml @@ -34,6 +34,8 @@ spec: value: "{{ .Values.exporter.testInterval }}" - name: IPERF_TEST_PROTOCOL value: "{{ .Values.exporter.testProtocol }}" + - name: LOG_LEVEL + value: "{{ .Values.exporter.logLevel }}" - name: IPERF_SERVER_PORT value: "5201" # Hardcoded as per server DaemonSet - name: IPERF_SERVER_NAMESPACE diff --git a/charts/iperf3-monitor/values.yaml b/charts/iperf3-monitor/values.yaml index d2de952..2d31853 100644 --- a/charts/iperf3-monitor/values.yaml +++ b/charts/iperf3-monitor/values.yaml @@ -24,6 +24,9 @@ exporter: # -- Interval in seconds between complete test cycles (i.e., testing all server nodes). testInterval: 300 + # -- Log level for the iperf3 exporter (e.g., DEBUG, INFO, WARNING, ERROR, CRITICAL). + logLevel: INFO + # -- Timeout in seconds for a single iperf3 test run. testTimeout: 10