Skip to content

refactor: refactor mtls test to support Istio 1.27+ native sidecars#883

Merged
averevki merged 1 commit intoKuadrant:mainfrom
emmaaroche:mtls-test-refactoring
Mar 10, 2026
Merged

refactor: refactor mtls test to support Istio 1.27+ native sidecars#883
averevki merged 1 commit intoKuadrant:mainfrom
emmaaroche:mtls-test-refactoring

Conversation

@emmaaroche
Copy link
Copy Markdown
Contributor

Description

  • Refactored mTLS test test_pods_have_istio_sidecar_and_labels to support Istio 1.27+ native sidecars which now default to initContainers instead of regular containers
  • Maintained backward compatibility with Istio <1.27 by checking both container locations

Closes #882

Changes

  • Updated test_pods_have_istio_sidecar_and_labels test to verify istio-proxy presence in both container locations
  • Updated wait_for_injected_pod fixture in conftest.py to check both spec.containers and spec.initContainers for the istio-proxy sidecar
  • Added or [] fallback when accessing initContainers as it's optional in the pod spec

Verification steps

Run the test on a cluster with Istio 1.27 (I tested on kua-420-2 which is configured with it):

 poetry run pytest -vv testsuite/tests/singlecluster/gateway/mtls/test_mtls_configuration.py::test_pods_have_istio_sidecar_and_labels

@emmaaroche emmaaroche self-assigned this Mar 10, 2026
@emmaaroche emmaaroche added the refactor Refactor with same functionality label Mar 10, 2026
@emmaaroche emmaaroche requested a review from silvi-t March 10, 2026 12:19
silvi-t
silvi-t previously approved these changes Mar 10, 2026
Copy link
Copy Markdown
Contributor

@silvi-t silvi-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@azgabur azgabur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests passed, otherwise LGTM

Comment thread testsuite/tests/singlecluster/gateway/mtls/test_mtls_configuration.py Outdated
Signed-off-by: emmaaroche <eroche@redhat.com>
@emmaaroche emmaaroche force-pushed the mtls-test-refactoring branch from 8bf5b0d to 60f29a8 Compare March 10, 2026 14:52
@emmaaroche emmaaroche requested review from azgabur and silvi-t and removed request for azgabur March 10, 2026 14:53
@averevki averevki merged commit 3367cbe into Kuadrant:main Mar 10, 2026
4 checks passed
@emmaaroche emmaaroche deleted the mtls-test-refactoring branch March 11, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactor with same functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor mtls test for native sidecars

4 participants