Skip to content

Commit e429e79

Browse files
authored
Merge pull request #788 from joelanford/ansible-e2e-ownerref
* test/ansible-operator/Dockerfile: fix e2e ownerref issue * hack/tests/e2e-ansible.sh: adding test to ensure garbage-collection succeeds
2 parents 00ef545 + 386a675 commit e429e79

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

hack/tests/e2e-ansible.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,18 @@ then
7373
fi
7474

7575
kubectl delete -f ${DIR2}/deploy/crds/ansible_v1alpha1_memcached_cr.yaml --wait=true
76-
kubectl logs deployment/memcached-operator | grep "this is a finalizer"
76+
if ! kubectl logs deployment/memcached-operator | grep "this is a finalizer";
77+
then
78+
kubectl logs deployment/memcached-operator
79+
exit 1
80+
fi
81+
82+
# The deployment should get garbage collected, so we expect to fail getting the deployment.
83+
if ! timeout 20s bash -c -- "while kubectl get deployment ${memcached_deployment}; do sleep 1; done";
84+
then
85+
kubectl logs deployment/memcached-operator
86+
exit 1
87+
fi
7788

7889
popd
7990
popd

test/ansible-operator/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
FROM ansible/ansible-runner
22

3+
RUN yum remove -y ansible python-idna
4+
RUN pip uninstall ansible-runner -y
5+
36
RUN pip install --upgrade setuptools
4-
RUN pip install urllib3==1.23
5-
RUN pip install openshift ansible-runner-http
7+
RUN pip install ansible ansible-runner openshift kubernetes ansible-runner-http
68

7-
RUN echo "localhost ansible_connection=local" > /etc/ansible/hosts \
9+
RUN mkdir -p /etc/ansible \
10+
&& echo "localhost ansible_connection=local" > /etc/ansible/hosts \
811
&& echo '[defaults]' > /etc/ansible/ansible.cfg \
912
&& echo 'roles_path = /opt/ansible/roles' >> /etc/ansible/ansible.cfg \
1013
&& echo 'library = /usr/share/ansible/openshift' >> /etc/ansible/ansible.cfg

0 commit comments

Comments
 (0)