Skip to content

Commit

Permalink
Update e2e tests (replace j2cli with gomplate)
Browse files Browse the repository at this point in the history
  • Loading branch information
s1061123 committed Apr 18, 2024
1 parent 9c2771b commit 82302cc
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/kind-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ jobs:
with:
python-version: 3.x

- name: Setup j2cli
run: |
sudo apt-get install -y j2cli
echo $(j2 --version)
- name: Build latest-amd64
uses: docker/build-push-action@v5
with:
Expand All @@ -63,7 +58,7 @@ jobs:

- name: generate yaml files
working-directory: ./e2e
run: env CNI_VERSION=${{ matrix.cni-version }} ./generate_yamls.sh
run: env CNI_VERSION=${{ matrix.cni-version }} PATH=${PATH}:./bin ./generate_yamls.sh

- name: Setup cluster
working-directory: ./e2e
Expand Down
2 changes: 1 addition & 1 deletion e2e/generate_yamls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ templates_dir="$(dirname $(readlink -f $0))/templates"
# generate yaml files based on templates/*.j2 to yamls directory
for i in `ls templates/`; do
echo $i
j2 -e CNI_VERSION ${templates_dir}/$i -o yamls/${i%.j2}
gomplate -o yamls/${i%.j2} -f ${templates_dir}/$i
done
unset CNI_VERSION
2 changes: 2 additions & 0 deletions e2e/get_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ curl -Lo ./bin/koko https://github.com/redhat-nfvpe/koko/releases/download/v0.83
chmod +x ./bin/koko
curl -Lo ./bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
chmod +x ./bin/jq
curl -Lo ./bin/gomplate https://github.com/hairyhenderson/gomplate/releases/download/v3.11.7/gomplate_linux-amd64-slim
chmod +x ./bin/gomplate
2 changes: 1 addition & 1 deletion e2e/templates/default-route1.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: default-route-config
spec:
config: '{
"cniVersion": "{{ CNI_VERSION }}",
"cniVersion": "{{ .Env.CNI_VERSION }}",
"plugins": [
{
"type": "macvlan",
Expand Down
13 changes: 10 additions & 3 deletions e2e/templates/multus-daemonset-thick.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ metadata:
data:
daemon-config.json: |
{
"chrootDir": "/hostroot",
"confDir": "/host/etc/cni/net.d",
"logToStderr": true,
"logLevel": "debug",
"logFile": "/tmp/multus.log",
"binDir": "/host/opt/cni/bin",
"binDir": "/opt/cni/bin",
"cniDir": "/var/lib/cni/multus",
"socketDir": "/host/run/multus",
"cniVersion": "{{ CNI_VERSION }}",
"cniVersion": "{{ .Env.CNI_VERSION }}",
"cniConfigDir": "/host/etc/cni/net.d",
"multusConfigFile": "auto",
"forceCNIVersion": true,
Expand Down Expand Up @@ -147,7 +148,7 @@ spec:
- name: cni
mountPath: /host/etc/cni/net.d
- name: cnibin
mountPath: /host/opt/cni/bin
mountPath: /opt/cni/bin
- name: host-run
mountPath: /host/run
- name: host-var-lib-cni-multus
Expand All @@ -158,6 +159,9 @@ spec:
- name: multus-daemon-config
mountPath: /etc/cni/net.d/multus.d
readOnly: true
- name: hostroot
mountPath: /hostroot
mountPropagation: HostToContainer
env:
- name: MULTUS_NODE_NAME
valueFrom:
Expand Down Expand Up @@ -187,6 +191,9 @@ spec:
- name: cnibin
hostPath:
path: /opt/cni/bin
- name: hostroot
hostPath:
path: /
- name: multus-daemon-config
configMap:
name: multus-daemon-config
Expand Down
2 changes: 1 addition & 1 deletion e2e/templates/multus-daemonset.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ spec:
args:
- "--multus-conf-file=auto"
- "--force-cni-version=true"
- "--cni-version={{ CNI_VERSION }}"
- "--cni-version={{ .Env.CNI_VERSION }}"
resources:
requests:
cpu: "100m"
Expand Down
2 changes: 1 addition & 1 deletion e2e/templates/simple-macvlan1.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: macvlan1-config
spec:
config: '{
"cniVersion": "{{ CNI_VERSION }}",
"cniVersion": "{{ .Env.CNI_VERSION }}",
"plugins": [
{
"type": "macvlan",
Expand Down

0 comments on commit 82302cc

Please sign in to comment.