Skip to content

Run Kyverno E2E with the Kubernetes Agent backend - #24672

Draft
nubtron wants to merge 57 commits into
masterfrom
nubtron/kyverno-kubernetes-agent-e2e
Draft

Run Kyverno E2E with the Kubernetes Agent backend#24672
nubtron wants to merge 57 commits into
masterfrom
nubtron/kyverno-kubernetes-agent-e2e

Conversation

@nubtron

@nubtron nubtron commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Runs the Kyverno Kind E2E Agent inside the test cluster through the Kubernetes Agent backend. The check now reaches the four Kyverno metrics services over in-cluster DNS instead of maintaining host port-forwards.

Validation:

  • cd ddev && hatch run -- ddev --no-interactive test -fs kyverno — passed.
  • cd ddev && hatch run -- ddev --no-interactive test --lint kyverno — passed.
  • cd ddev && hatch run -- ddev --no-interactive test kyverno — 6 passed, 1 E2E test skipped by the unit-test run.
  • cd ddev && hatch run -- ddev env start --dev kyverno py3.13 — started the dedicated Kind cluster and Kubernetes Agent.
  • cd ddev && hatch run -- ddev env test --dev kyverno py3.13 — 1 E2E test passed.
  • cd ddev && hatch run -- ddev env stop kyverno py3.13 — deleted the dedicated Kind cluster.

Motivation

Builds on #24639 to exercise the Kubernetes Agent backend against Kyverno while preserving the existing E2E coverage and startup behavior.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@nubtron nubtron added the qa/skip-qa Automatically skip this PR for the next QA label Jul 23, 2026
@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 85.14% (-3.28%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 37eb94a | Docs | Datadog PR Page | Give us feedback!

@nubtron
nubtron force-pushed the nubtron/kyverno-kubernetes-agent-e2e branch 4 times, most recently from 0b4ceca to 17dd895 Compare July 30, 2026 13:31
nubtron added 24 commits August 10, 2026 09:27
Clarified the implementation details regarding Kubernetes node support.
Reading self.metadata['kubernetes'] unguarded turned a missing metadata
block into a bare KeyError, so an environment that selects agent_type
'kubernetes' without the accompanying mapping failed with 'Unable to
start the Agent: kubernetes' and gave a raw traceback from ddev env
shell, which only handles CalledProcessError.

Validate the mapping where it is read so the failure names the missing
contract instead.
start() stamped PREPARED_MARKER after _restart_agent_process(), so a
container replaced during the restart was marked prepared. The marker
lives in the container filesystem and the pod declares no volumes, so a
replacement loses the copied conf.yaml, auto_conf.yaml and the editable
installs, while _wait_for_agent() still succeeds against the fresh
container. Every later _require_prepared() check then passed and tests
silently exercised the Agent-shipped integration with no configuration.

Stamp the marker once preparation is complete and assert it after the
restart, matching the invariant restart() already relies on. Checking
after the stamp instead would only observe the gap between the two
commands.
@nubtron
nubtron force-pushed the nubtron/kubernetes-agent-interface-e2e branch from 2a64043 to f21cf4c Compare August 10, 2026 09:28
@nubtron
nubtron force-pushed the nubtron/kyverno-kubernetes-agent-e2e branch from c922643 to 37eb94a Compare August 10, 2026 09:34
@dd-octo-sts

dd-octo-sts Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

Base automatically changed from nubtron/kubernetes-agent-interface-e2e to master August 10, 2026 17:43
An error occurred while trying to automatically change base from nubtron/kubernetes-agent-interface-e2e to master August 10, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration/kyverno qa/skip-qa Automatically skip this PR for the next QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant