From dcb90d3525eab8653578cf519115f05e09fe0d7b Mon Sep 17 00:00:00 2001 From: Tim Pansino Date: Mon, 13 May 2024 17:07:03 -0700 Subject: [PATCH] Fix issues with CI --- .github/workflows/python.yml | 13 ++++++------- tests/python/customresource.yaml | 8 +++----- tests/python/test_app_deployment.yaml | 4 ++-- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 540c6d2..08d7e78 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -30,7 +30,7 @@ on: - published env: - INITCONTAINER_LANGUAGE: ${{ env.INITCONTAINER_LANGUAGE }} + INITCONTAINER_LANGUAGE: python jobs: test: @@ -56,12 +56,11 @@ jobs: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml kubectl wait --for=condition=Ready --namespace cert-manager --all pods - - name: Deploy newrelic-agent-operator to minikube + - name: Deploy New Relic k8s-agents-operator to minikube run: | - kubectl create namespace newrelic - helm repo add newrelic-agent-operator https://newrelic-experimental.github.io/newrelic-agent-operator - helm upgrade --install newrelic-agent-operator newrelic-agent-operator/newrelic-agent-operator --set licenseKey=${{ secrets.K8S_AGENTS_E2E_LICENSE_KEY }} -n newrelic - kubectl wait --for=condition=Ready --namespace newrelic --all pods + helm repo add k8s-agents-operator https://newrelic.github.io/k8s-agents-operator + helm upgrade --install k8s-agents-operator k8s-agents-operator/k8s-agents-operator --namespace k8s-agents-operator --create-namespace + kubectl wait --for=condition=Ready --namespace k8s-agents-operator --all pods - name: Build init container run: | @@ -76,9 +75,9 @@ jobs: - name: Deploy test app to minikube run: | kubectl create namespace test-${{ env.INITCONTAINER_LANGUAGE }} + kubectl create secret generic newrelic-key-secret -n test-python --from-literal=new_relic_license_key=$NEW_RELIC_LICENSE_KEY kubectl apply -f tests/${{ env.INITCONTAINER_LANGUAGE }}/customresource.yaml -n test-${{ env.INITCONTAINER_LANGUAGE }} kubectl apply -f tests/${{ env.INITCONTAINER_LANGUAGE }}/test_app_deployment.yaml -n test-${{ env.INITCONTAINER_LANGUAGE }} - sleep 5 kubectl wait --for=condition=Ready --namespace test-${{ env.INITCONTAINER_LANGUAGE }} --all pods - name: Test diff --git a/tests/python/customresource.yaml b/tests/python/customresource.yaml index 7bebe60..759f7f1 100644 --- a/tests/python/customresource.yaml +++ b/tests/python/customresource.yaml @@ -9,15 +9,13 @@ metadata: spec: python: image: e2e/initcontainer-python:e2e + # Configure agent for testing using environment variables env: - # Put the agent in developer mode so it doesn't try to connect to the real collector. - - name: NEW_RELIC_DEVELOPER_MODE - value: "true" - name: NEW_RELIC_STARTUP_TIMEOUT value: "30" - - # TODO: Remove these hacks - name: NEW_RELIC_STARTUP_DEBUG value: "true" + + # TODO: Remove these hacks - name: NEW_RELIC_K8S_OPERATOR_ENABLED value: "true" diff --git a/tests/python/test_app_deployment.yaml b/tests/python/test_app_deployment.yaml index c465c01..4292b70 100644 --- a/tests/python/test_app_deployment.yaml +++ b/tests/python/test_app_deployment.yaml @@ -23,7 +23,7 @@ spec: - containerPort: 8000 env: - name: NEW_RELIC_APP_NAME - value: "k8s-e2e-test-app-${SCENARIO_TAG:-0}" + value: k8s-e2e-test-app-python --- apiVersion: v1 kind: Service @@ -35,4 +35,4 @@ spec: - port: 8000 targetPort: 8000 selector: - app: test-app-python + app: test-app-python