aboutsummaryrefslogtreecommitdiffstats
path: root/security/scripts/check_security_root.sh
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2021-08-31 10:45:18 +0200
committerKrzysztof Opasiak <k.opasiak@samsung.com>2021-08-31 14:45:18 +0000
commit1ee65ab7801cd0d209ce31f96b9daa063bc7b6b3 (patch)
tree7c29fe7c60d816efe1a3e640ca78bd434ba5e037 /security/scripts/check_security_root.sh
parent771c3370182ba117978edf296c9145cb387e2c1b (diff)
[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 <k.opasiak@samsung.com> Change-Id: I3d451c1e6c11841bf64afe876bbe33edbb42556c
Diffstat (limited to 'security/scripts/check_security_root.sh')
-rwxr-xr-x[-rw-r--r--]security/scripts/check_security_root.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/scripts/check_security_root.sh b/security/scripts/check_security_root.sh
index f5b55c3..5b614d4 100644..100755
--- 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