Skip to content

Commit 0b8a5cf

Browse files
fix(ci): fix run e2e if audit disabled
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
1 parent 5d05add commit 0b8a5cf

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

tests/e2e/Taskfile.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,33 @@ tasks:
159159
echo "Error: Deckhouse is not ready."
160160
exit 1
161161
fi
162+
162163
d8 k patch mpo virtualization --type merge -p "{\"spec\":{\"imageTag\":\"$v12n_tag\"}}"
163164
images_hash=$(crane export "dev-registry.deckhouse.io/sys/deckhouse-oss/modules/virtualization:$v12n_tag" - | tar -Oxf - images_digests.json)
165+
164166
v12n_pods=$(kubectl -n d8-virtualization get pods -o json | jq -c)
167+
168+
audit_status=$(kubectl get mc virtualization -o=jsonpath='{.spec.settings.audit.enabled}')
169+
audit_image_skip=$(if [ -z $audit_status ] || [ $audit_status == "false" ]; then echo "false";else echo "true";fi)
170+
165171
retry_count=0
166172
max_retries=120
167173
sleep_interval=5
168174
175+
if [ $audit_image_skip == "true" ]; then
176+
SKIP_IMAGES=("virtualizationAudit")
177+
178+
is_skipped_image() {
179+
local img="$1"
180+
for skip in "${SKIP_IMAGES[@]}"; do
181+
if [[ "$img" == "$skip" ]]; then
182+
return 0 # image found in skip list
183+
fi
184+
done
185+
return 1 # image not in skip list
186+
}
187+
}
188+
169189
while true; do
170190
all_hashes_found=true
171191
@@ -181,6 +201,11 @@ tasks:
181201
continue
182202
fi
183203
204+
if is_skipped_image "$image"; then
205+
echo "- ⏭️ Skipping $image"
206+
continue
207+
fi
208+
184209
if echo "$v12n_pods" | grep -q "$hash"; then
185210
echo "- ✅ $image $hash"
186211
else

0 commit comments

Comments
 (0)