Skip to content

Commit 357b529

Browse files
author
Isaak Dorfman
authored
Cnfcert 30 changes (#29)
1 parent 7604d7e commit 357b529

File tree

6 files changed

+111
-45
lines changed

6 files changed

+111
-45
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
.PHONY: install \
22
clean
33

4-
install:
5-
bash ./deploy-all.sh
4+
install: install-partner-pods
5+
bash ./deploy-test-pods.sh
6+
7+
install-partner-pods:
8+
bash ./deploy-partner-pods.sh
69

710
clean:
811
bash ./clean-all.sh

deploy-all.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

deploy-partner-pods.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
mkdir -p ./temp
2+
3+
if [[ -z "${NAMESPACE_TO_GENERATE}" ]]; then
4+
export NAMESPACE_TO_GENERATE="tnf"
5+
fi
6+
7+
export res=$(oc get namespace $NAMESPACE_TO_GENERATE 2>&1)
8+
if [[ ${res#Error from server (NotFound)} != ${res} ]] || [[ ${res#No resources found} != ${res} ]]; then
9+
cat ./local-test-infra/namespace.yaml | ./script/mo > ./temp/rendered-namespace.yaml
10+
oc apply -f ./temp/rendered-namespace.yaml
11+
rm ./temp/rendered-namespace.yaml
12+
else
13+
echo "namespace ${NAMESPACE_TO_GENERATE} already exists, no reason to recreate"
14+
fi
15+
16+
if [[ -n "${TNF_MINIKUBE_ONLY}" ]] && [[ ${TNF_MINIKUBE_ONLY} = "true" ]]; then
17+
echo "Running with Minikube, no FsDiff pod created"
18+
else
19+
cat ./local-test-infra/fsdiff-deployment.yaml | ./script/mo > ./temp/rendered-fsdiff-template.yaml
20+
oc apply -f ./temp/rendered-fsdiff-template.yaml
21+
rm ./temp/rendered-fsdiff-template.yaml
22+
sleep 3
23+
oc wait pod -n $NAMESPACE_TO_GENERATE --for=condition=ready -l "app=node-master" --timeout=30s
24+
fi
25+
26+
27+
cat ./local-test-infra/local-partner-deployment.yaml | ./script/mo > ./temp/rendered-partner-template.yaml
28+
oc apply -f ./temp/rendered-partner-template.yaml
29+
rm ./temp/rendered-partner-template.yaml
30+
sleep 3
31+
oc wait pod -n $NAMESPACE_TO_GENERATE --for=condition=ready -l "app=partner" --timeout=30s

deploy-test-pods.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
mkdir -p ./temp
2+
3+
if [[ -z "${NAMESPACE_TO_GENERATE}" ]]; then
4+
export NAMESPACE_TO_GENERATE="tnf"
5+
fi
6+
7+
8+
cat ./local-test-infra/local-pod-under-test.yaml | ./script/mo > ./temp/rendered-local-pod-under-test-template.yaml
9+
oc apply -f ./temp/rendered-local-pod-under-test-template.yaml
10+
rm ./temp/rendered-local-pod-under-test-template.yaml
11+
sleep 3
12+
oc wait pod -n $NAMESPACE_TO_GENERATE --for=condition=ready -l "app=test" --timeout=30s
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: node-master
6+
namespace: {{ NAMESPACE_TO_GENERATE }}
7+
test-network-function.com/generic: fs_diff_master
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: node-master
13+
template:
14+
metadata:
15+
labels:
16+
app: node-master
17+
test-network-function.com/generic: fs_diff_master
18+
test-network-function.com/container: fs_diff_master
19+
annotations:
20+
test-network-function.com/defaultnetworkinterface: '"eth0"' # optional
21+
name: node-master
22+
spec:
23+
# hostPID: true
24+
containers:
25+
- command:
26+
- tail
27+
- -f
28+
- /dev/null
29+
image: quay.io/testnetworkfunction/cnf-test-partner:latest # quay.io/testnetworkfunction/test-network-function
30+
name: master
31+
resources:
32+
limits:
33+
memory: 512Mi
34+
cpu: 0.25
35+
volumeMounts:
36+
- mountPath: /var/lib/containers
37+
name: var-lib-containers
38+
- mountPath: /var/run/containers
39+
name: var-run-containers
40+
- mountPath: /run/runc
41+
name: runc-dir
42+
- mountPath: /var/run/containers/storage/overlay-containers
43+
name: overlay-containers
44+
securityContext:
45+
privileged: true
46+
restartPolicy: Always
47+
volumes:
48+
- name: var-lib-containers
49+
hostPath:
50+
path: /var/lib/containers
51+
type: Directory
52+
- name: var-run-containers
53+
hostPath:
54+
path: /var/run/containers
55+
type: Directory
56+
- name: runc-dir
57+
hostPath:
58+
path: /run/runc
59+
type: Directory
60+
- name: overlay-containers
61+
hostPath:
62+
path: /var/run/containers/storage/overlay-containers
63+
type: Directory

0 commit comments

Comments
 (0)