Skip to content

Commit 90cb56c

Browse files
committed
remove hardcoded namespace
1 parent a76270d commit 90cb56c

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

.github/workflows/java-eks-otlp-ocb-canary.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
## Logs, metrics, and traces are all validated.
99
name: Java EKS OTLP/OCB Enablement Canary Test
1010
on:
11-
schedule:
12-
- cron: '12,37 * * * *' # run the workflow at 12th and 37th minute of every hour
11+
# TODO: Reintroduce cron-job
12+
# schedule:
13+
# - cron: '12,37 * * * *' # run the workflow at 12th and 37th minute of every hour
1314
workflow_dispatch: # be able to run the workflow on demand
15+
push:
16+
branches:
17+
- otlp-ocb
1418

1519
permissions:
1620
id-token: write

.github/workflows/java-eks-otlp-ocb-test.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ jobs:
6969
- name: Generate testing id and sample app namespace
7070
run: |
7171
echo TESTING_ID="${{ github.job }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" >> $GITHUB_ENV
72-
echo SAMPLE_APP_NAMESPACE="default" >> $GITHUB_ENV
73-
# echo SAMPLE_APP_NAMESPACE="ns-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
72+
echo SAMPLE_APP_NAMESPACE="ns-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV
7473
7574
- uses: actions/checkout@v4
7675
with:
@@ -196,6 +195,7 @@ jobs:
196195
with:
197196
command: "cd ${{ env.TEST_RESOURCES_FOLDER }}/terraform/java/eks-otlp-ocb/util && \
198197
sed -i -e 's/${E2E_TEST_AWS_REGION}/${{ env.E2E_TEST_AWS_REGION }}/g' ./appsignals-collector.yaml && \
198+
sed -i -e 's/${SAMPLE_APP_NAMESPACE}/${{ env.SAMPLE_APP_NAMESPACE }}/g' ./appsignals-collector.yaml && \
199199
kubectl apply -f ./appsignals-collector.yaml -n ${{ env.SAMPLE_APP_NAMESPACE }}"
200200
cleanup: "kubectl delete -f ./appsignals-collector.yaml -n ${{ env.SAMPLE_APP_NAMESPACE }} && \
201201
aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ${{ env.E2E_TEST_AWS_REGION }}"
@@ -331,8 +331,6 @@ jobs:
331331
echo "validation-result=failure" >> $GITHUB_OUTPUT
332332
fi
333333
334-
# TODO: Simplify cleanup
335-
# Can just use `kubectl delete ns -n ${{ env.SAMPLE_APP_NAMESPACE }}` once the namespace is no longer hardcoded
336334
- name: Clean up
337335
if: always()
338336
continue-on-error: true
@@ -341,11 +339,8 @@ jobs:
341339
run: |
342340
aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ${{ env.E2E_TEST_AWS_REGION }}
343341
eksctl delete iamserviceaccount --name cloudwatch-agent --namespace amazon-cloudwatch --cluster ${{ env.CLUSTER_NAME }} --region ${{ env.E2E_TEST_AWS_REGION }}
344-
kubectl delete -f ./appsignals-collector.yaml -n ${{ env.SAMPLE_APP_NAMESPACE }}
345342
kubectl delete ns opentelemetry-operator-system
346-
kubectl delete deploy --all -n ${{ env.SAMPLE_APP_NAMESPACE }}
347-
kubectl delete service sample-remote-app-service -n ${{ env.SAMPLE_APP_NAMESPACE }}
348-
kubectl delete service sample-app-service -n ${{ env.SAMPLE_APP_NAMESPACE }}
343+
kubectl delete ns -n ${{ env.SAMPLE_APP_NAMESPACE }}
349344
aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ${{ env.E2E_TEST_AWS_REGION }}
350345
351346
- name: Terraform destroy

terraform/java/eks-otlp-ocb/util/appsignals-collector.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ metadata:
3333
subjects:
3434
- kind: ServiceAccount
3535
name: appsignals-collector
36-
namespace: default
36+
namespace: ${SAMPLE_APP_NAMESPACE}
3737
roleRef:
3838
kind: ClusterRole
3939
name: otel-collector-role

0 commit comments

Comments
 (0)