74
74
DATABASE_USER=" postgres"
75
75
DATABASE_PASSWORD=" postgres-password"
76
76
77
+ function dump_debug_info() {
78
+ announce " Showing summary of Kubernetes objects in $CONJUR_NAMESPACE namespace"
79
+ kubectl get all -n " $CONJUR_NAMESPACE "
80
+
81
+ announce " Showing Conjur OSS Server logs"
82
+ kubectl logs -l " app=conjur-oss" -c conjur-oss
83
+
84
+ announce " Showing Conjur OSS NGINX logs"
85
+ kubectl logs -l " app=conjur-oss" -c " $RELEASE_NAME " -nginx
86
+
87
+ announce " Showing Postgres logs"
88
+ kubectl logs -l " app=conjur-oss-postgres"
89
+
90
+ announce " Showing Kubernetes nodes"
91
+ kubectl describe nodes
92
+
93
+ announce " Showing details of Kubernetes objects in $CONJUR_NAMESPACE namespace"
94
+ kubectl get all -n " $CONJUR_NAMESPACE " -o yaml
95
+ }
96
+
77
97
function delete_release() {
78
98
announce " Deleting Conjur Helm release $RELEASE_NAME "
79
99
echo " HELM_DEL_ARGS: $HELM_DEL_ARGS "
@@ -89,6 +109,11 @@ function delete_release() {
89
109
fi
90
110
}
91
111
112
+ function dump_debug_and_delete_release() {
113
+ dump_debug_info
114
+ delete_release
115
+ }
116
+
92
117
announce " Installing Conjur OSS, waiting until server is ready..."
93
118
data_key=" $( docker run --rm cyberark/conjur data-key generate) "
94
119
echo " RELEASE_NAME: $RELEASE_NAME "
@@ -102,17 +127,19 @@ echo "HELM_INSTALL_ARGS: $HELM_INSTALL_ARGS"
102
127
echo " HELM_INSTALL_TIMEOUT: $HELM_INSTALL_TIMEOUT "
103
128
echo " Helm Version: $( helm version) "
104
129
echo " Kubernetes Version: $( kubectl version) "
130
+ trap dump_debug_info EXIT
105
131
helm install --wait \
106
132
--timeout $HELM_INSTALL_TIMEOUT \
107
133
--set " dataKey=$data_key " \
108
134
$HELM_INSTALL_ARGS \
109
135
$RELEASE_ARG \
110
136
./conjur-oss
111
- trap delete_release EXIT
137
+ trap dump_debug_and_delete_release EXIT
112
138
113
139
announce " Running helm tests"
114
140
echo " HELM_TEST_ARGS: $HELM_TEST_ARGS "
115
141
helm test $HELM_TEST_ARGS " $RELEASE_NAME "
142
+ trap delete_release EXIT
116
143
117
144
if [[ (! is_helm_v2) && (" $HELM_TEST_LOGGING " == true) ]]; then
118
145
# Test pod log has been displayed, so it's safe to delete the test pod.
0 commit comments