Skip to content

Commit bd6eba5

Browse files
fix(ci): fix run e2e if audit disabled (#1048)
Fix run e2e if audit disabled --------- Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
1 parent 66f400a commit bd6eba5

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

tests/e2e/Taskfile.yaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,34 @@ tasks:
180180
echo "Error: Deckhouse is not ready."
181181
exit 1
182182
fi
183-
d8 k patch mpo virtualization --type merge -p "{\"spec\":{\"imageTag\":\"$v12n_tag\"}}"
183+
184+
d8 k patch mpo virtualization --type merge -p "{\"spec\":{\"imageTag\":\"$v12n_tag\"}}"
184185
images_hash=$(crane export "dev-registry.deckhouse.io/sys/deckhouse-oss/modules/virtualization:$v12n_tag" - | tar -Oxf - images_digests.json)
186+
185187
v12n_pods=$(kubectl -n d8-virtualization get pods -o json | jq -c)
188+
189+
audit_status=$(kubectl get mc virtualization -o=jsonpath='{.spec.settings.audit.enabled}')
190+
audit_image_skip=$(if [ -z $audit_status ] || [ $audit_status == "false" ]; then echo "false";else echo "true";fi)
191+
186192
retry_count=0
187193
max_retries=120
188-
sleep_interval=5
194+
sleep_interval=5
195+
196+
if [ $audit_image_skip == "true" ]; then
197+
SKIP_IMAGES=("virtualizationAudit")
198+
fi
199+
200+
is_skipped_image() {
201+
local img="$1"
202+
if [ ${#img} -eq 0 ]; then return 1 ;fi
203+
204+
for skip in "${SKIP_IMAGES[@]}"; do
205+
if [[ "$img" == "$skip" ]]; then
206+
return 0 # image found in skip list
207+
fi
208+
done
209+
return 1 # image not in skip list
210+
}
189211
190212
while true; do
191213
all_hashes_found=true
@@ -202,6 +224,11 @@ tasks:
202224
continue
203225
fi
204226
227+
if is_skipped_image "$image"; then
228+
echo "- ⏭️ Skipping $image"
229+
continue
230+
fi
231+
205232
if echo "$v12n_pods" | grep -q "$hash"; then
206233
echo "- ✅ $image $hash"
207234
else

0 commit comments

Comments
 (0)