Skip to content

Commit 5976745

Browse files
committed
[v1alpha1] move webhook types to internal/webhook
1 parent 96663b8 commit 5976745

File tree

11 files changed

+523
-498
lines changed

11 files changed

+523
-498
lines changed

.chloggen/move_webhooks.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: breaking
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
5+
component: v1alpha1
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Move webhooks from the apis/v1alpha1 package to the internal package internal/webhook
9+
10+
# One or more tracking issues related to the change
11+
issues: [4837]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext:

apis/v1alpha1/opampbridge_webhook_test.go

Lines changed: 0 additions & 306 deletions
This file was deleted.

internal/controllers/suite_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import (
5959
"github.com/open-telemetry/opentelemetry-operator/internal/manifests/collector/testdata"
6060
"github.com/open-telemetry/opentelemetry-operator/internal/manifests/manifestutils"
6161
"github.com/open-telemetry/opentelemetry-operator/internal/rbac"
62+
wh "github.com/open-telemetry/opentelemetry-operator/internal/webhook"
6263
)
6364

6465
var (
@@ -219,17 +220,17 @@ func TestMain(m *testing.M) {
219220
fmt.Printf("failed to SetupWebhookWithManager: %v", err)
220221
os.Exit(1)
221222
}
222-
if err = v1alpha1.SetupTargetAllocatorWebhook(mgr, config.New(), reviewer); err != nil {
223+
if err = wh.SetupTargetAllocatorWebhook(mgr, config.New(), reviewer); err != nil {
223224
fmt.Printf("failed to SetupWebhookWithManager: %v", err)
224225
os.Exit(1)
225226
}
226227

227-
if err = v1alpha1.SetupTargetAllocatorWebhook(mgr, config.New(), reviewer); err != nil {
228+
if err = wh.SetupTargetAllocatorWebhook(mgr, config.New(), reviewer); err != nil {
228229
fmt.Printf("failed to SetupWebhookWithManager: %v", err)
229230
os.Exit(1)
230231
}
231232

232-
if err = v1alpha1.SetupOpAMPBridgeWebhook(mgr, config.New()); err != nil {
233+
if err = wh.SetupOpAMPBridgeWebhook(mgr, config.New()); err != nil {
233234
fmt.Printf("failed to SetupWebhookWithManager: %v", err)
234235
os.Exit(1)
235236
}

internal/instrumentation/upgrade/upgrade_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919

2020
"github.com/open-telemetry/opentelemetry-operator/apis/v1alpha1"
2121
"github.com/open-telemetry/opentelemetry-operator/internal/config"
22+
"github.com/open-telemetry/opentelemetry-operator/internal/webhook"
2223
"github.com/open-telemetry/opentelemetry-operator/pkg/constants"
2324
)
2425

@@ -59,7 +60,7 @@ func TestUpgrade(t *testing.T) {
5960
EnableNodeJSAutoInstrumentation: true,
6061
EnableJavaAutoInstrumentation: true,
6162
}
62-
err = v1alpha1.NewInstrumentationWebhook(
63+
err = webhook.NewInstrumentationWebhook(
6364
logr.Discard(),
6465
testScheme,
6566
cfg,

0 commit comments

Comments
 (0)