Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add a justfile #7

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM alpine:3.18

COPY --chown=root:root /target/aarch64-unknown-linux-musl/debug/agent /app/
COPY --chown=root:root /target/aarch64-unknown-linux-musl/debug/sinabro-cni /sinabro-cni
ARG ARCH

COPY --chown=root:root /target/${ARCH}-unknown-linux-musl/debug/agent /app/
COPY --chown=root:root /target/${ARCH}-unknown-linux-musl/debug/sinabro-cni /sinabro-cni

ENV RUST_LOG=info

Expand Down
16 changes: 16 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
setup-kind-cluster:
kind create cluster --config tests/e2e/kind-config.yaml
cargo xtask build-ebpf
cargo build --target $(uname -m)-unknown-linux-musl
docker build --build-arg ARCH=$(uname -m) -t sinabro:test .
kind load docker-image sinabro:test

clean-kind-cluster:
kind delete cluster

deploy-agent: setup-kind-cluster
kubectl apply -f tests/e2e/deploy-test/00-install.yaml

deploy-test-pods: deploy-agent
kubectl taint nodes kind-control-plane node-role.kubernetes.io/control-plane-
kubectl apply -f tests/e2e/deploy-test/01-test-pods.yaml
43 changes: 0 additions & 43 deletions test/README.md

This file was deleted.

7 changes: 3 additions & 4 deletions test/agent.yaml → tests/e2e/deploy-test/00-install.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down Expand Up @@ -59,15 +58,15 @@ spec:
serviceAccountName: sinabro
initContainers:
- name: install-cni-bin
image: sinabro:0.0.1
image: sinabro:test
imagePullPolicy: IfNotPresent
command: ['sh', '-c', 'chmod +x /sinabro-cni && cp /sinabro-cni /cni/sinabro-cni']
volumeMounts:
- name: cni-bin
mountPath: /cni
containers:
- name: agent
image: sinabro:0.0.1
image: sinabro:test
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
Expand Down Expand Up @@ -98,4 +97,4 @@ spec:
- name: cni-cfg
hostPath:
path: /etc/cni/net.d
type: DirectoryOrCreate
type: DirectoryOrCreate
File renamed without changes.
File renamed without changes.