Skip to content

fix: Fix AuthBridge sidecar injection for agent and tool workloads - #84

Merged
mrsabath merged 2 commits into
rossoctl:mainfrom
cwiklik:inject-authbridge-to-agent-tool
Jan 29, 2026
Merged

mrsabath merged 2 commits into
rossoctl:mainfrom
cwiklik:inject-authbridge-to-agent-tool

Conversation

@cwiklik

@cwiklik cwiklik commented Jan 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR fixes the AuthBridge sidecar injection to properly target workloads with Kagenti labels.

Fixes #55

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-deployment
  namespace: team1
  labels:
    kagenti.io/inject: enabled
    kagenti.io/type: agent
    kagenti.io/spire: enabled
spec:
  replicas: 1
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      labels:
        app: test
      annotations:
        foo: bar
    spec:
      containers:
      - name: nginx
        image: nginx:latest
EOF

Deployed the above and observed the number of containers in a pod to be 3. Repeated the test with modified Deployment using a different label: kagenti.io/type: tool. Ran another experiment with modified Deployment with no kagenti.io/type: agent label. In the last case, there is a single container.

Test Configuration:

  • Kubernetes version:
  • OS: mac

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (if appropriate)

Below is a screenshot when Deployment with label: kagenti.io/type: agent

image

Below is a screenshot when Deployment is missing label: kagenti.io/type: agent
image

Additional Notes

  • Update mutating webhook to inject AuthBridge sidecar into pods with label kagenti.io/type: agent
  • Update mutating webhook to inject AuthBridge sidecar into pods with label kagenti.io/type: tool

@cwiklik cwiklik changed the title bug: Fix AuthBridge sidecar injection for agent and tool workloads fix: Fix AuthBridge sidecar injection for agent and tool workloads Jan 28, 2026
@cwiklik cwiklik changed the title fix: Fix AuthBridge sidecar injection for agent and tool workloads fix: Fix AuthBridge sidecar injection for agent and tool workloads Jan 28, 2026
Signed-off-by: cwiklik <[email protected]>
@mrsabath

Copy link
Copy Markdown
Member

@cwiklik , in your testing example we should also include the new label: kagenti.io/spire: enabled:

    kagenti.io/inject: enabled
    kagenti.io/spire: enabled

@mrsabath mrsabath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested and it works fine, assuming SPIRE is enabled. I will fix the error when SPIRE is disabled. That is independent of this PR

LGTM

@mrsabath
mrsabath merged commit 5105c15 into rossoctl:main Jan 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend admission webhook to inject AuthBridge sidecar for Deployments with tools labels

3 participants