Skip to content

Commit

Permalink
Cleanup docker images
Browse files Browse the repository at this point in the history
Signed-off-by: Navin Chandra <[email protected]>
  • Loading branch information
navin772 committed Aug 5, 2024
1 parent 5888118 commit b8c308a
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/ci-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
matrix:
os: [ubuntu-20.04, bpflsm]
runtime: ["containerd", "crio"]
exclude:
- os: bpflsm
runtime: crio
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -34,6 +37,14 @@ jobs:
with:
go-version-file: 'KubeArmor/go.mod'

- name: Check what paths were updated
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
controller:
- 'pkg/KubeArmorController/**'
- name: Install the latest LLVM toolchain
run: ./.github/workflows/install-llvm.sh

Expand All @@ -54,6 +65,10 @@ jobs:
run: |
make docker-build
- name: Build KubeArmorController
if: steps.filter.outputs.controller == 'true'
run: make -C pkg/KubeArmorController/ docker-build TAG=latest

- name: deploy pre existing pod
run: |
kubectl apply -f ./tests/k8s_env/ksp/pre-run-pod.yaml
Expand All @@ -67,6 +82,10 @@ jobs:
docker save kubearmor/kubearmor-test:latest | sudo k3s ctr images import -
docker save kubearmor/kubearmor-operator:latest | sudo k3s ctr images import -
docker save kubearmor/kubearmor-snitch:latest | sudo k3s ctr images import -
if [[ ${{ steps.filter.outputs.controller }} == 'true' ]]; then
docker save kubearmor/kubearmor-controller:latest | sudo k3s ctr images import -
fi
else
if [ ${{ matrix.runtime }} == "crio" ]; then
docker save kubearmor/kubearmor-test-init:latest | sudo podman load
Expand All @@ -77,12 +96,24 @@ jobs:
sudo podman tag localhost/latest:latest docker.io/kubearmor/kubearmor-operator:latest
docker save kubearmor/kubearmor-snitch:latest | sudo podman load
sudo podman tag localhost/latest:latest docker.io/kubearmor/kubearmor-snitch:latest
if [ ${{ steps.filter.outputs.controller }} == 'true' ]; then
docker save kubearmor/kubearmor-controller:latest | sudo podman load
sudo podman tag localhost/latest:latest docker.io/kubearmor/kubearmor-controller:latest
fi
fi
fi
docker system prune -a -f
docker buildx prune -a -f
helm upgrade --install kubearmor-operator ./deployments/helm/KubeArmorOperator -n kubearmor --create-namespace --set kubearmorOperator.image.tag=latest
kubectl wait --for=condition=ready --timeout=5m -n kubearmor pod -l kubearmor-app=kubearmor-operator
kubectl get pods -A
kubectl apply -f pkg/KubeArmorOperator/config/samples/kubearmor-coverage.yaml
if [[ ${{ steps.filter.outputs.controller }} == 'true' ]]; then
kubectl apply -f pkg/KubeArmorOperator/config/samples/kubearmor-coverage.yaml --dry-run=client -o json | \
jq '.spec.kubearmorControllerImage.imagePullPolicy = "Never"' | \
kubectl apply -f -
else
kubectl apply -f pkg/KubeArmorOperator/config/samples/kubearmor-coverage.yaml
fi
# kubectl wait -n kubearmor --timeout=5m --for=jsonpath='{.status.phase}'=Running kubearmorconfigs/kubearmorconfig-test
# kubectl wait --timeout=7m --for=condition=ready pod -l kubearmor-app,kubearmor-app!=kubearmor-snitch,kubearmor-app!=kubearmor-controller -n kubearmor
# kubectl wait --timeout=1m --for=condition=ready pod -l kubearmor-app=kubearmor-controller -n kubearmor
Expand Down

0 comments on commit b8c308a

Please sign in to comment.