-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ssi): create injector interface and refactor webhooks
This commit adds an injector interface and refactors the tagsfromlabels and the config webhooks to use it. This will allow us to use the injector logic without needing to instantiate a webhook.
- Loading branch information
1 parent
748d0b8
commit 5ed5b03
Showing
8 changed files
with
706 additions
and
558 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
//go:build kubeapiserver | ||
|
||
package common | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
"k8s.io/client-go/dynamic" | ||
) | ||
|
||
// Injector provides a common interface for building components capable of | ||
// mutating pods so that individual webhooks can share injectors. | ||
type Injector interface { | ||
// InjectPod will optionally inject a pod, returning true if injection occurs and an error if there is a problem. | ||
// This must match the MutateFunc signature. | ||
InjectPod(pod *corev1.Pod, ns string, dc dynamic.Interface) (bool, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.