From: Krzysztof Opasiak Date: Tue, 31 Aug 2021 08:45:18 +0000 (+0200) Subject: [SECURITY] Add -- to kubectl exec X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=1ee65ab7801cd0d209ce31f96b9daa063bc7b6b3;p=integration%2Fxtesting.git [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 --- 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