Skip to content

Commit

Permalink
Update testing workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Oct 11, 2024
1 parent 10fc2d6 commit 9296b4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,13 @@ jobs:
- name: Start minikube
uses: medyagh/setup-minikube@d8c0eb871f6f455542491d86a574477bd3894533 # 0.0.18

- name: Deploy cert-manager to minikube
run: |
helm repo add jetstack https://charts.jetstack.io --force-update
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.14.5 --set installCRDs=true
sleep 5
kubectl wait --for=condition=Ready -n cert-manager --all pods
- name: Deploy New Relic k8s-agents-operator to minikube
run: |
helm uninstall k8s-agents-operator --ignore-not-found
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=default \
--set=licenseKey=${{ secrets.NEW_RELIC_LICENSE_KEY }} \
--set=newRelicHost=${{ vars.NEW_RELIC_HOST }} \
--set=controllerManager.manager.image.tag=${{ inputs.K8S_OPERATOR_IMAGE_TAG }}
sleep 5
kubectl wait --for=condition=Ready -n default --all pods
Expand Down
16 changes: 8 additions & 8 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,41 @@ cert-manager:

# Install official k8s-agents-operator repo
.PHONY: operator
operator: cert-manager license_key_secret
operator:
helm uninstall k8s-agents-operator --ignore-not-found
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 \
--create-namespace \
--namespace=k8s-agents-operator \
--namespace=newrelic \
--set=licenseKey=${NEW_RELIC_LICENSE_KEY} \
--set=controllerManager.manager.image.tag=edge
sleep 1
kubectl wait --for=condition=Ready -n k8s-agents-operator --all pods
kubectl wait --for=condition=Ready -n newrelic --all pods

# Build and install local copy of k8s-agents-operator
.PHONY: operator-local
operator-local: license_key_secret
operator-local:
eval $$(minikube docker-env --shell=bash) && \
docker build ${LOCAL_OPERATOR_REPO_PATH}/ -t e2e/k8s-agents-operator:e2e
helm uninstall k8s-agents-operator --ignore-not-found
sleep 1
helm upgrade --install k8s-agents-operator ${LOCAL_OPERATOR_REPO_PATH}/charts/k8s-agents-operator/ \
--create-namespace \
--namespace=k8s-agents-operator \
--namespace=newrelic \
--set=licenseKey=${NEW_RELIC_LICENSE_KEY} \
--set=controllerManager.manager.image.pullPolicy=Never \
--set=controllerManager.manager.image.repository=e2e/k8s-agents-operator \
--set=controllerManager.manager.image.tag=e2e
sleep 1
kubectl wait --for=condition=Ready -n k8s-agents-operator --all pods
kubectl wait --for=condition=Ready -n newrelic --all pods

# Set license key in default namespace
.PHONY: license_key_secret
license_key_secret:
kubectl delete secret newrelic-key-secret --ignore-not-found
kubectl delete secret newrelic-key-secret --namespace=newrelic newrelic --ignore-not-found
kubectl create secret generic newrelic-key-secret \
--from-literal="new_relic_license_key=${NEW_RELIC_LICENSE_KEY}" \
-n default
--namespace=newrelic

# Build local initcontainer image
.PHONY: build-initcontainer
Expand Down

0 comments on commit 9296b4a

Please sign in to comment.