Skip to content

fix: CI infrastructure fixes (SCC, webhook build, port-forward) - #1022

Closed
Ladas wants to merge 10 commits into
rossoctl:mainfrom
Ladas:fix/ci-infra-fixes
Closed

Ladas wants to merge 10 commits into
rossoctl:mainfrom
Ladas:fix/ci-infra-fixes

Conversation

@Ladas

@Ladas Ladas commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Summary

CI infrastructure fixes split from #998 per review feedback.

  • Custom kagenti-authbridge SCC with explicit ClusterRole for OpenShift agent namespaces
  • Relaxed requiredDropCapabilities from ALL to MKNOD (sidecars don't specify drop: ALL)
  • Webhook build script: correct build context (kagenti-webhook/ subdir) and dynamic deployment discovery
  • Port-forward: use kubectl wait for deployment readiness instead of kubectl exec (which targets sidecar container)
  • Default KAGENTI_EXTENSIONS_REF=main to build webhook from extensions main (has merged 🐛 add volumes and volume mounts to agents as well #242 fix)

Test plan

  • Kind Deploy & Test passes (port-forward fix)
  • HyperShift E2E passes (SCC + webhook build)

🤖 Generated with Claude Code

Ladas added 7 commits March 17, 2026 23:13
The kagenti-webhook chart (v0.4.0-alpha.5) still uses privileged: true
for the proxy-init container. Until kagenti-extensions#234 is released
with capabilities instead, default to building the webhook from the
fix branch so all HyperShift E2E runs pass without manual --extensions-ref.

Remove this default after bumping the webhook chart dependency.

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
The Dockerfile expects go.mod at the build context root, but the
build was sending the entire repo root. Change --from-dir to point
at the kagenti-webhook/ subdirectory and update dockerfilePath
accordingly.

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
The rollout restart assumed deployment name 'kagenti-webhook' but the
actual name depends on the helm chart's fullnameOverride. Find the
deployment dynamically and skip if not found.

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
OpenShift auto-creates ClusterRoles for built-in SCCs (anyuid,
privileged, etc.) but does not reliably do so for custom SCCs.
The RoleBinding in agent-namespaces.yaml references
system:openshift:scc:kagenti-authbridge which may not exist,
causing "Forbidden: not usable by user or serviceaccount".

Create the ClusterRole explicitly in the Helm chart so the
RoleBinding works immediately.

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
The port-forward script grabbed the pod name once and failed if the
pod disappeared (eviction, restart, slow startup). Now retries for
up to 2 minutes, re-querying the deployment each iteration, and
outputs diagnostic events on failure.

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
Two fixes:
1. Port-forward: use kubectl wait for deployment condition instead of
   kubectl exec (which targets sidecar container, not the agent)
2. Default KAGENTI_EXTENSIONS_REF to main (fix merged as rossoctl#242)

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
requiredDropCapabilities: ALL forces every container to specify
capabilities.drop: [ALL], but the webhook-injected sidecars (envoy,
spiffe-helper, client-registration) don't set this. The SCC rejects
the pod because only the proxy-init container drops ALL capabilities.

Change to MKNOD (matching anyuid SCC pattern) so sidecars and agent
containers aren't rejected for missing capabilities.drop: [ALL].

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
@Ladas

Ladas commented Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label Mar 17, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 67590e11540b9bc559309290bdddd53e2bd2396d
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

Ladas added 2 commits March 17, 2026 23:53
The packaged webhook chart (v0.4.0-alpha.5) uses proxy-init:latest
which was updated by extensions#250 and is now incompatible with the
old webhook binary (missing POD_IP env var injection).

Add webhook rebuild between platform install and agent deploy on Kind,
matching the HyperShift CI pattern.

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
…d fixes

Replace the webhook-specific build script with a generic pattern that
supports building any dependency from branch, tag, PR number, or commit SHA.

Hardcoded override section in deploy scripts defaults to building
kagenti-extensions@main until the webhook chart is bumped past v0.4.0-alpha.8.
Remove the hardcoded entry after bumping the chart dependency.

Ref formats: branch, tag, pr/<number>, <commit-sha>

New scripts:
- 30-build-dep-image.sh: Generic image builder with dep registry
- 31-build-deps-from-refs.sh: Orchestrator reading KAGENTI_DEP_BUILDS JSON

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label Mar 17, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: 5d3891e

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@Ladas

Ladas commented Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label Mar 17, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: 8a40fe412be1b52b9abd906e18c489dd9ce64a75
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 67590e11540b9bc559309290bdddd53e2bd2396d
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

Parse --build org/repo=ref flags from /run-e2e comments to build
dependency images from custom branches, PRs, or commits.

Examples:
  /run-e2e --build kagenti/kagenti-extensions=fix/my-branch
  /run-e2e --build kagenti/kagenti-extensions=pr/234
  /run-e2e --build kagenti/kagenti-extensions=a5607f9
  /run-e2e --build kagenti/kagenti-extensions=pr/234 --build kagenti/kagenti-operator=feat/new-crd

Security: only repos in the allow list are accepted
(kagenti/kagenti-extensions, kagenti/kagenti-operator).

Backwards compatible with --extensions-ref.

Signed-off-by: Ladislav Smola <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
@Ladas
Ladas force-pushed the fix/ci-infra-fixes branch from 8a40fe4 to f31374b Compare March 17, 2026 23:03
@Ladas

Ladas commented Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

/run-e2e

@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label Mar 17, 2026
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: f31374b

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions github-actions Bot added the safe-to-test Maintainer reviewed - safe to run E2E tests label Mar 17, 2026
@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Started

Triggered by: @Ladas
Commit: f31374ba8be25af68d238cd805929af528fa50d1
Workflow Run: View logs

Tests are running on OpenShift 4.20.11. This typically takes 30-45 minutes.


To re-run tests after new commits, comment /run-e2e again.

@Ladas
Ladas force-pushed the fix/ci-infra-fixes branch from f31374b to e3a5477 Compare March 17, 2026 23:04
@github-actions

Copy link
Copy Markdown

New Commits Detected

The safe-to-test label has been automatically removed because new commits were pushed.

New HEAD: e3a5477

For maintainers: Please review the new changes and comment /run-e2e to trigger E2E tests.

Security checklist

Before running E2E tests, verify the PR does NOT contain:

  • Changes to .github/workflows/ that bypass security
  • Changes to .github/scripts/ that could exfiltrate secrets
  • curl, wget, or nc commands to external URLs in scripts
  • Base64 encoding of environment variables
  • Printing secrets to logs (echo $SECRET)
  • Suspicious package installations

This is an automated security measure to prevent TOCTOU attacks

@github-actions github-actions Bot removed the safe-to-test Maintainer reviewed - safe to run E2E tests label Mar 17, 2026
@Ladas

Ladas commented Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by new PR with proper explanation of combined changes.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: 8a40fe412be1b52b9abd906e18c489dd9ce64a75
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

@github-actions

Copy link
Copy Markdown

E2E HyperShift Tests Failed

Commit: f31374ba8be25af68d238cd805929af528fa50d1
Result: Tests failed - please check the logs
Workflow Run: View logs


To re-run tests after fixing issues, comment /run-e2e again.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant