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

Update e2e tests (replace j2cli with gomplate) #1265

Closed
wants to merge 1 commit into from
Closed
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
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
Loading