Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
pawarpranav83 committed May 31, 2024
1 parent e0aae9a commit 9ff0a78
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 3 deletions.
60 changes: 58 additions & 2 deletions .github/workflows/inspektor-gadget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,6 @@ jobs:
- build-ig
- build-helper-images
- check-secrets
- public-key-check
runs-on: ubuntu-latest
permissions:
# allow publishing container image
Expand Down Expand Up @@ -1397,7 +1396,7 @@ jobs:
make \
GADGET_REPOSITORY=${{ steps.set-repo-determine-image-tag.outputs.gadget-repository }} \
GADGET_TAG=${{ steps.set-repo-determine-image-tag.outputs.gadget-tag }} \
-C gadgets/ test -o build
-C gadgets/ test-ig-local -o build
test-integration-non-k8s-ig:
name: Test ig w/o k8s
Expand Down Expand Up @@ -1776,6 +1775,63 @@ jobs:
done
gcloud container clusters delete --project ${{ secrets.GKE_PROJECT }} --region ${{ matrix.flavor.region }} ${{ env.CLUSTER_NAME }} --async --quiet
test-gadgets-k8s:
name: Test gadgets
#level 3
needs:
- build-ig
- build-gadget-container-images
- build-helper-images
- build-and-push-gadgets
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
runtime: [docker, containerd, cri-o]
steps:
- uses: actions/checkout@v4
- name: Set container repository and determine image tag
id: set-repo-determine-image-tag
uses: ./.github/actions/set-container-repo-and-determine-image-tag
with:
registry: ${{ env.REGISTRY }}
container-image: ${{ env.CONTAINER_REPO }}
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
id: go
- name: Setup minikube
uses: ./.github/actions/setup-minikube
with:
runtime: ${{ matrix.runtime }}
multi-node: true
- name: Get gadget-container-image-linux-amd64.tar from artifact.
uses: actions/download-artifact@v3
with:
name: gadget-container-image-linux-amd64.tar
path: /home/runner/work/inspektor-gadget/
- name: Prepare minikube by loading gadget-container-image-linux-amd64.tar
run: |
# 'docker load' ensures the image is named correctly e.g podman has issues loading untagged images from archive
docker load -i /home/runner/work/inspektor-gadget/gadget-container-image-linux-amd64.tar
minikube image load ${{ steps.set-repo-determine-image-tag.outputs.container-repo }}:${{ steps.set-repo-determine-image-tag.outputs.image-tag }}
- name: Get kubectl-gadget-linux-amd64.tar.gz from artifact.
uses: actions/download-artifact@v3
with:
name: kubectl-gadget-linux-amd64-tar-gz
path: /home/runner/work/inspektor-gadget/inspektor-gadget/
- name: Gadgets tests
run: |
tar zxvf /home/runner/work/inspektor-gadget/inspektor-gadget/kubectl-gadget-linux-amd64.tar.gz
./kubectl-gadget deploy --image-pull-policy=Never --debug --experimental --image=${{ steps.set-repo-determine-image-tag.outputs.container-repo }}:${{ steps.set-repo-determine-image-tag.outputs.image-tag }}
make \
GADGET_REPOSITORY=${{ steps.set-repo-determine-image-tag.outputs.gadget-repository }} \
GADGET_TAG=${{ steps.set-repo-determine-image-tag.outputs.gadget-tag }} \
KUBECTL_GADGET=../kubectl-gadget \
-C gadgets/ test-k8s -o build
test-integration-minikube:
name: Integr. tests
# level: 3
Expand Down
2 changes: 1 addition & 1 deletion pkg/testing/ig/ig.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type runner struct {
}

func (ig *runner) createCmd() {
ig.flags = append(ig.flags, "-o=json")
ig.flags = append(ig.flags, "-o=json", "--verify-image=false")
args := append([]string{"run", ig.image}, ig.flags...)

ig.Cmd = exec.Command(ig.path, args...)
Expand Down

0 comments on commit 9ff0a78

Please sign in to comment.