Skip to content

Commit

Permalink
Remove updates from pod mutating webhook (open-telemetry#2584)
Browse files Browse the repository at this point in the history
* Remove 'update' from pod mutating webhook for autoinstrumentation

* Revert shebang

* Add chlog entry

* Rename chloggen file
  • Loading branch information
andrewdinunzio authored Mar 4, 2024
1 parent c902659 commit 2e18cac
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .chloggen/webhook-remove-pod-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'bug_fix'

# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Removes UPDATE from pod mutating admission webhook since it only needs to mutate on pod CREATE events."

# One or more tracking issues related to the change
issues: [1514]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: "The pod webhook currently modifies the pod spec in invalid ways on UPDATE events, and UPDATES are not necessary in the webhook."
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ metadata:
categories: Logging & Tracing,Monitoring
certified: "false"
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
createdAt: "2024-03-01T10:16:23Z"
createdAt: "2024-03-04T14:38:01Z"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand Down Expand Up @@ -587,7 +587,6 @@ spec:
- v1
operations:
- CREATE
- UPDATE
resources:
- pods
sideEffects: None
Expand Down
1 change: 0 additions & 1 deletion config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ webhooks:
- v1
operations:
- CREATE
- UPDATE
resources:
- pods
sideEffects: None
Expand Down
2 changes: 1 addition & 1 deletion internal/webhook/podmutation/webhookhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/open-telemetry/opentelemetry-operator/internal/config"
)

// +kubebuilder:webhook:path=/mutate-v1-pod,mutating=true,failurePolicy=ignore,groups="",resources=pods,verbs=create;update,versions=v1,name=mpod.kb.io,sideEffects=none,admissionReviewVersions=v1
// +kubebuilder:webhook:path=/mutate-v1-pod,mutating=true,failurePolicy=ignore,groups="",resources=pods,verbs=create,versions=v1,name=mpod.kb.io,sideEffects=none,admissionReviewVersions=v1
// +kubebuilder:rbac:groups="",resources=namespaces,verbs=list;watch
// +kubebuilder:rbac:groups=opentelemetry.io,resources=opentelemetrycollectors,verbs=get;list;watch
// +kubebuilder:rbac:groups=opentelemetry.io,resources=instrumentations,verbs=get;list;watch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8464,7 +8464,6 @@ webhooks:
- v1
operations:
- CREATE
- UPDATE
resources:
- pods
sideEffects: None
Expand Down

0 comments on commit 2e18cac

Please sign in to comment.