-
Notifications
You must be signed in to change notification settings - Fork 23.7k
/
runme.sh
executable file
·61 lines (50 loc) · 1.3 KB
/
runme.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
if [[ $(python --version 2>&1) =~ 2\.6 ]]
then
echo "Openshift client is not supported on Python 2.6"
exit 0
fi
set -eux
source virtualenv.sh
pip install openshift -c constraints.txt
./server.py &
# Fake auth file
mkdir -p ~/.kube/
cat <<EOF > ~/.kube/config
apiVersion: v1
clusters:
- cluster:
insecure-skip-tls-verify: true
server: http://localhost:12345
name: development
contexts:
- context:
cluster: development
user: developer
name: dev-frontend
current-context: dev-frontend
kind: Config
preferences: {}
users:
- name: developer
user:
token: ZDNg7LzSlp8a0u0fht_tRnPMTOjxqgJGCyi_iy0ecUw
EOF
#################################################
# RUN THE PLUGIN
#################################################
# run the plugin second
export ANSIBLE_INVENTORY_ENABLED=kubevirt
export ANSIBLE_INVENTORY=test.kubevirt.yml
cat << EOF > "$OUTPUT_DIR/test.kubevirt.yml"
plugin: kubevirt
connections:
- namespaces:
- default
EOF
ANSIBLE_JINJA2_NATIVE=1 ansible-inventory -vvvv -i "$OUTPUT_DIR/test.kubevirt.yml" --list --output="$OUTPUT_DIR/plugin.out"
kill -9 "$(jobs -p)"
#################################################
# DIFF THE RESULTS
#################################################
./inventory_diff.py "$(pwd)/test.out" "$OUTPUT_DIR/plugin.out"