Skip to content

nr-ebpf-agent-1.4.8 #102

nr-ebpf-agent-1.4.8

nr-ebpf-agent-1.4.8 #102

name: Post-Release Agent Metadata Update
permissions:
contents: read
on:
release:
types: [released]
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag to simulate (e.g. pipeline-control-gateway-1.2.3)'
required: true
jobs:
update-agent-metadata:
name: Update metadata for ${{ matrix.chart }}
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }}
strategy:
matrix:
include:
- chart: nr-ebpf-agent
agent-type: NReBPFAgent
config-directory: charts/nr-ebpf-agent/.fleetControl
monitoring-type: INFRA
display-name: "New Relic eBPF Agent"
- chart: nri-bundle
agent-type: NRInfra
config-directory: charts/nri-bundle/.fleetControl
monitoring-type: INFRA
display-name: "New Relic Infrastructure"
- chart: nr-k8s-otel-collector
agent-type: NRDOT
config-directory: charts/nr-k8s-otel-collector/.fleetControl
monitoring-type: INFRA
display-name: "New Relic OpenTelemetry Collector"
- chart: newrelic-logging
agent-type: FluentBit
config-directory: charts/newrelic-logging/.fleetControl
monitoring-type: INFRA
display-name: "Fluent Bit"
- chart: pipeline-control-gateway
agent-type: PipelineControlGateway
config-directory: charts/pipeline-control-gateway/.fleetControl/pipeline-control
display-name: "Pipeline Control"
- chart: pipeline-control-gateway
agent-type: PipelineControlGatewayConfigMode
config-directory: charts/pipeline-control-gateway/.fleetControl/pipeline-control-config-mode
display-name: "Pipeline Control Gateway Config Mode"
- chart: agent-control-deployment
agent-type: NRAgentControl
config-directory: charts/agent-control-deployment/.fleetControl
display-name: "New Relic Agent Control"
fail-fast: false
steps:
- name: Check if release matches chart
id: should-run
run: |
TAG="${{ env.RELEASE_TAG }}"
CHART="${{ matrix.chart }}"
if [[ "$TAG" == "$CHART-"* ]]; then
echo "match=true" >> $GITHUB_OUTPUT
echo "✓ Release tag $TAG matches chart $CHART"
else
echo "match=false" >> $GITHUB_OUTPUT
echo "⊘ Release tag $TAG does not match chart $CHART - skipping"
fi
- name: Checkout repository
if: steps.should-run.outputs.match == 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.RELEASE_TAG }}
- name: Extract version from release tag or values.yaml
if: steps.should-run.outputs.match == 'true'
id: version
run: |
if [[ "${{ matrix.chart }}" == "agent-control-deployment" ]]; then
## agent-control we use the version of agent-control under the hood instead of the helm version
## cause we need the version to setup requirements that the agent is supported by the agent-control
VERSION=$(yq '.image.tag' charts/${{ matrix.chart }}/values.yaml | tr -d '"')
echo "Extracted version from '.image.tag' in values.yaml: $VERSION"
else
VERSION="${{ env.RELEASE_TAG }}"
VERSION="${VERSION#${{ matrix.chart }}-}"
echo "Extracted version from tag: $VERSION"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Final version: $VERSION for chart ${{ matrix.chart }}"
- name: Check .fleetControl directory
if: steps.should-run.outputs.match == 'true'
id: check-config
run: |
if [ -d "${{ matrix.config-directory }}" ] && [ "$(ls -A ${{ matrix.config-directory }})" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "✓ Directory ${{ matrix.config-directory }} exists and contains files"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "::warning::Directory ${{ matrix.config-directory }} does not exist or is empty. Skipping agent metadata update for ${{ matrix.chart }}."
fi
- name: Upload to Agent Metadata
if: steps.should-run.outputs.match == 'true' && steps.check-config.outputs.exists == 'true'
uses: newrelic/agent-metadata-action@v1.2.0
with:
newrelic-client-id: ${{ secrets.NEWRELIC_CLIENT_ID }}
newrelic-private-key: ${{ secrets.NEWRELIC_PRIVATE_KEY }}
agent-type: ${{ matrix.agent-type }}
version: ${{ steps.version.outputs.version }}
git-ref: ${{ env.RELEASE_TAG }}
config-directory: ${{ matrix.config-directory }}
monitoring-type: ${{ matrix.monitoring-type }}
display-name: ${{ matrix.display-name }}
apm-control-nr-license-key: ${{ secrets.APM_CONTROL_NR_LICENSE_KEY_STAGING }}