Skip to content

chore: Remove deprecated Agent CR webhook from Helm chart and codebase #151

Closed

Description

@cwiklik

Summary

The Agent CR (agent.kagenti.dev/v1alpha1) has been deprecated and the CR itself has been removed. The corresponding webhook handlers and Helm chart templates should be removed.

Files to Remove

Helm chart templates (charts/kagenti-webhook/templates/):

  • agent-mutatingwebhook.yaml — registers /mutate-agent-kagenti-dev-v1alpha1-agent
  • agent-validatingwebhook.yaml — registers /validate-agent-kagenti-dev-v1alpha1-agent

Go implementation (kagenti-webhook/internal/webhook/v1alpha1/):

  • agent_webhook.go — webhook handler (AgentWebhook, SetupAgentWebhookWithManager)

Registration (kagenti-webhook/cmd/ or main.go):

  • Remove the call to SetupAgentWebhookWithManager from the manager setup

Generated manifests (kagenti-webhook/config/webhook/):

  • Remove the Agent entries from manifests.yaml

Follow-up Cleanup (once both Agent and MCPServer are removed)

Once this issue and #150 are both resolved, the following deprecated code in pod_mutator.go can also be removed:

  • ShouldMutate method (deprecated, only used by Agent/MCPServer path)
  • NeedsMutation method (deprecated, only used by Agent/MCPServer path)
  • MutatePodSpec method (deprecated, only used by Agent/MCPServer path)
  • InjectSidecars / InjectSidecarsWithSpireOption methods
  • InjectInitContainers / InjectVolumes / InjectVolumesWithSpireOption methods

Acceptance Criteria

  • Helm chart no longer renders MutatingWebhookConfiguration or ValidatingWebhookConfiguration for agents
  • Go webhook handler is deleted
  • Manager no longer registers the Agent webhook path
  • go build ./... and go test ./... pass
  • helm lint charts/kagenti-webhook passes
  • No references to agent.kagenti.dev remain in the webhook codebase

Related

Activity

  1. self-assigned this
    on Feb 26, 2026
  2. added theissue type on Feb 26, 2026
  3. added a commit that references this issue on Feb 28, 2026
    1aa6fe1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions