From 1ee65ab7801cd0d209ce31f96b9daa063bc7b6b3 Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Tue, 31 Aug 2021 10:45:18 +0200 Subject: [SECURITY] Add -- to kubectl exec According to warning that is printed by tests: kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead. Fix this by just adding -- to avoid this warning. Issue-ID: OOM-1 Signed-off-by: Krzysztof Opasiak Change-Id: I3d451c1e6c11841bf64afe876bbe33edbb42556c --- security/scripts/check_security_root.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 security/scripts/check_security_root.sh (limited to 'security/scripts/check_security_root.sh') diff --git a/security/scripts/check_security_root.sh b/security/scripts/check_security_root.sh old mode 100644 new mode 100755 index f5b55c3..5b614d4 --- a/security/scripts/check_security_root.sh +++ b/security/scripts/check_security_root.sh @@ -55,7 +55,7 @@ code=0 for pod in `kubectl get pod -n $K8S_NAMESPACE| grep "Running" | grep -v functest | grep -v integration | awk '{print $1}'` ;do list=`kubectl top pod $pod --containers -n onap |grep -v "POD"|awk '{print $1":"$2}'`; for po in $list; do - contname=`echo $po|cut -d':' -f2`;uid=`kubectl exec $pod --container $contname -n $K8S_NAMESPACE id|sed -r "s/^uid=(.*) gid.*$/\1/"`;echo "POD: $pod container: $contname uid: $uid"; + contname=`echo $po|cut -d':' -f2`;uid=`kubectl exec $pod --container $contname -n $K8S_NAMESPACE -- id|sed -r "s/^uid=(.*) gid.*$/\1/"`;echo "POD: $pod container: $contname uid: $uid"; done; done | grep root > $FILTERED_PODS_LIST -- cgit 1.2.3-korg