fix docker and nginx

This commit is contained in:
Eugenio Marzo
2021-01-03 10:49:01 +01:00
parent 3b6d0f3026
commit b6f5bb3331
2 changed files with 4 additions and 4 deletions
+1
View File
@@ -17,6 +17,7 @@ RUN apt-get -y install openresty
# Install kube-linter
RUN curl -L -O https://github.com/stackrox/kube-linter/releases/download/0.1.5/kube-linter-linux.tar.gz
RUN tar -xvf kube-linter-linux.tar.gz
RUN rm -f kube-linter-linux.tar.gz
RUN cp kube-linter /usr/local/bin/
RUN chmod 775 /usr/local/bin/kube-linter
COPY kube-linter/kube-linter-parser.sh /opt/kube-linter-parser.sh
+3 -4
View File
@@ -3,7 +3,7 @@
# Very temporary work-around
KUBE=$(cat /etc/nginx/conf.d/KubeInvaders.conf | grep proxy_pass | head -n1 | awk '{ print $2 }' | sed 's/;//g')
POD_FILE=/tmp/${3}.yaml
POD_FILE=/tmp/${3}.json
curl -XGET "${KUBE}/api/v1/namespaces/${2}/pods/${3}" --header "Authorization: Bearer ${4}" --silent -k > ${POD_FILE}
[ ! $? -eq 0 ] && (echo "{}" && exit 0)
@@ -17,8 +17,7 @@ if [ $wcl -gt 0 ];then
do
echo $line | sed -n 's/^\([^\ ]*\)\ \(([^\(]*)\)\ \(.*\)$/\3/p'
done | jq -R -s -c 'split("\n")'
rm -f ${POD_FILE}
else
echo "{}"
fi
fi