Skip to content

tests: integration: cover kubernetes pod association isolation - #12208

Merged
edsiper merged 1 commit into
masterfrom
kubernetes-pod-association-12152
Aug 4, 2026
Merged

tests: integration: cover kubernetes pod association isolation#12208
edsiper merged 1 commit into
masterfrom
kubernetes-pod-association-12152

Conversation

@edsiper

@edsiper edsiper commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

Add focused Python integration coverage for Kubernetes pod association when two filter instances are configured.

Each filter targets an independent local TLS endpoint. The test requires both instances to complete repeated refresh cycles and verifies clean shutdown.

Context

PR #12153 fixed the process-global pod-association thread, mutex, event loop, and context state that allowed multiple Kubernetes filter instances to overwrite and concurrently destroy shared state.

This follow-up protects that per-instance ownership and lifecycle behavior from regression.

Refs #12152
Follow-up to #12153

Verification

  • make -j 8
  • tests/integration/.venv/bin/python -m pytest tests/integration/scenarios/filter_kubernetes/tests/test_filter_kubernetes_001.py::test_filter_kubernetes_pod_association_is_independent_per_instance -q
    • 1 passed
  • VALGRIND=1 VALGRIND_STRICT=1 tests/integration/.venv/bin/python -m pytest tests/integration/scenarios/filter_kubernetes/tests/test_filter_kubernetes_001.py::test_filter_kubernetes_pod_association_is_independent_per_instance -q
    • 1 passed
    • 0 errors, 0 leaks
  • tests/integration/.venv/bin/python -m pytest tests/integration/scenarios/filter_kubernetes/tests/test_filter_kubernetes_001.py -q
    • 3 passed
  • GITHUB_EVENT_NAME=pull_request GITHUB_BASE_REF=master tests/integration/.venv/bin/python .github/scripts/commit_prefix_check.py
    • passed

Summary by CodeRabbit

  • Tests
    • Added integration coverage for Kubernetes filters using secure mutual TLS connections.
    • Verified that multiple filters independently refresh their associated pod endpoints.
    • Added synchronized request tracking to confirm repeated refresh behavior across separate filter configurations.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 765d714f-bb8e-449d-be84-cb8514700bd8

📥 Commits

Reviewing files that changed from the base of the PR and between e52822e and 350ba70.

📒 Files selected for processing (1)
  • tests/integration/scenarios/filter_kubernetes/tests/test_filter_kubernetes_001.py

📝 Walkthrough

Walkthrough

The integration test adds threaded TLS pod-association servers, generates configuration for two Kubernetes filters with separate endpoints, and verifies that both filters perform multiple independent refresh requests.

Changes

Kubernetes filter refresh validation

Layer / File(s) Summary
TLS pod-association test servers
tests/integration/scenarios/filter_kubernetes/tests/test_filter_kubernetes_001.py
The test adds TLS support, synchronized request counting, JSON responses, suppressed logging, and controlled server shutdown.
Independent filter refresh scenario
tests/integration/scenarios/filter_kubernetes/tests/test_filter_kubernetes_001.py
The generated configuration creates two Kubernetes filters with separate TLS endpoints. The integration test verifies multiple refresh requests from each endpoint.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • fluent/fluent-bit#12153: Tests multi-instance Kubernetes filter pod-association behavior with independent refresh servers.

Suggested reviewers: cosmo0920, leonardo-albertovich

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kubernetes-pod-association-12152

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@edsiper
edsiper marked this pull request as ready for review August 4, 2026 04:11
@edsiper
edsiper requested a review from cosmo0920 as a code owner August 4, 2026 04:11
@edsiper
edsiper merged commit 5db2f97 into master Aug 4, 2026
41 of 44 checks passed
@edsiper
edsiper deleted the kubernetes-pod-association-12152 branch August 4, 2026 04:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 350ba70208

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

import http.server
import os
import shlex
import ssl

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the required DCO sign-off

The commit message has no Signed-off-by: trailer, so it does not satisfy the repository's DCO requirement; recreate the commit with git commit -s before submission.

AGENTS.md reference: AGENTS.md:L140-L140

Useful? React with 👍 / 👎.

assert "kube token command test" in log_text


def test_filter_kubernetes_pod_association_is_independent_per_instance(tmp_path):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wrap the commit body to 80 columns

Several commit-message lines exceed the repository's 80-character limit, including prose at 91–197 characters and verification commands up to 230 characters; rewrap the body before submission.

AGENTS.md reference: AGENTS.md:L138-L138

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant