Repository: open-telemetry/opentelemetry-operator
Pull request #3632 (2025-01-20 00:45:40)

[chore] move all target-allocator code to internal
**Description:**
This is a proposed change and a test to see if we can move all the code under target allocator to internal, meaning its API is no longer public and exported.


swiatekm: Looks good to me, broadly speaking. I would even consider moving all of it out of `cmd/` and into `internal/targetallocator`.

Patch:
diff --git a/.chloggen/3474.yaml b/.chloggen/3474.yaml
deleted file mode 100755
index aa03078b..00000000
--- a/.chloggen/3474.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: breaking
-
-# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
-component: operator
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Make ServiceMonitor for operator metrics optional and disable it by default
-
-# One or more tracking issues related to the change
-issues: [3474]
-
-# (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: |
-  Add `--create-sm-operator-metrics` flag to create a ServiceMonitor for the operator metrics.
-  This is disabled by default, which is a breaking change, because it was enabled by default in 0.113.0 and 0.114.0.
\ No newline at end of file
diff --git a/.chloggen/cap-urllib3-for-py38-support.yaml b/.chloggen/cap-urllib3-for-py38-support.yaml
deleted file mode 100755
index 6e59b36a..00000000
--- a/.chloggen/cap-urllib3-for-py38-support.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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. collector, target allocator, auto-instrumentation, opamp, github action)
-component: auto-instrumentation
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: add upper version limit to Python dependency urllib3
-
-# One or more tracking issues related to the change
-issues: [3616]
-
-# (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:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c47855bd..c62cf8e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,31 @@
 
 <!-- next version -->
 
+## 0.119.0
+
+### 🛑 Breaking changes 🛑
+
+- `operator`: Make ServiceMonitor for operator metrics optional and disable it by default (#3474)
+  Add `--create-sm-operator-metrics` flag to create a ServiceMonitor for the operator metrics.
+  This is disabled by default, which is a breaking change, because it was enabled by default in 0.113.0 and 0.114.0.
+
+### 🧰 Bug fixes 🧰
+
+- `auto-instrumentation`: add upper version limit to Python dependency urllib3 (#3616)
+- `target allocator`: check for Prometheus CRDs before watching Service/Pod Monitors (#3726)
+
+### Components
+
+* [OpenTelemetry Collector - v0.119.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.119.0)
+* [OpenTelemetry Contrib - v0.119.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.119.0)
+* [Java auto-instrumentation - v1.33.6](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.33.6)
+* [.NET auto-instrumentation - v1.2.0](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/v1.2.0)
+* [Node.JS - v0.53.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.53.0)
+* [Python - v0.51b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.51b0)
+* [Go - v0.19.0-alpha](https://github.com/open-telemetry/opentelemetry-go-instrumentation/releases/tag/v0.19.0-alpha)
+* [ApacheHTTPD - 1.0.4](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.4)
+* [Nginx - 1.0.4](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.4)
+
 ## 0.118.0
 
 ### 🚀 New components 🚀
diff --git a/RELEASE.md b/RELEASE.md
index 5b028e8c..17620945 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -44,10 +44,10 @@ The operator should be released within a week after the [OpenTelemetry collector
 
 | Version  | Release manager |
 |----------|-----------------|
-| v0.119.0 | @frzifus        |
 | v0.120.0 | @yuriolisa      |
 | v0.121.0 | @pavolloffay    |
 | v0.122.0 | @TylerHelmuth   |
 | v0.123.0 | @jaronoff97     |
 | v0.124.0 | @swiatekm       |
 | v0.125.0 | @iblancasa      |
+| v0.126.0 | @frzifus        |
diff --git a/bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml b/bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml
index 52e24c5e..fd77d844 100644
--- a/bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml
+++ b/bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml
@@ -99,13 +99,13 @@ metadata:
     categories: Logging & Tracing,Monitoring
     certified: "false"
     containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
-    createdAt: "2025-02-13T16:48:37Z"
+    createdAt: "2025-02-24T07:53:50Z"
     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
     repository: github.com/open-telemetry/opentelemetry-operator
     support: OpenTelemetry Community
-  name: opentelemetry-operator.v0.118.0
+  name: opentelemetry-operator.v0.119.0
   namespace: placeholder
 spec:
   apiservicedefinitions: {}
@@ -529,7 +529,7 @@ spec:
                   valueFrom:
                     fieldRef:
                       fieldPath: spec.serviceAccountName
-                image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.118.0
+                image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.119.0
                 livenessProbe:
                   httpGet:
                     path: /healthz
@@ -637,7 +637,7 @@ spec:
   minKubeVersion: 1.23.0
   provider:
     name: OpenTelemetry Community
-  version: 0.118.0
+  version: 0.119.0
   webhookdefinitions:
   - admissionReviewVersions:
     - v1alpha1
diff --git a/bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml b/bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml
index f8dfcf99..1933fb17 100644
--- a/bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml
+++ b/bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml
@@ -99,13 +99,13 @@ metadata:
     categories: Logging & Tracing,Monitoring
     certified: "false"
     containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
-    createdAt: "2025-02-13T16:48:37Z"
+    createdAt: "2025-02-24T07:53:51Z"
     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
     repository: github.com/open-telemetry/opentelemetry-operator
     support: OpenTelemetry Community
-  name: opentelemetry-operator.v0.118.0
+  name: opentelemetry-operator.v0.119.0
   namespace: placeholder
 spec:
   apiservicedefinitions: {}
@@ -534,7 +534,7 @@ spec:
                   valueFrom:
                     fieldRef:
                       fieldPath: spec.serviceAccountName
-                image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.118.0
+                image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.119.0
                 livenessProbe:
                   httpGet:
                     path: /healthz
@@ -653,7 +653,7 @@ spec:
   minKubeVersion: 1.23.0
   provider:
     name: OpenTelemetry Community
-  version: 0.118.0
+  version: 0.119.0
   webhookdefinitions:
   - admissionReviewVersions:
     - v1alpha1
diff --git a/cmd/otel-allocator/allocation/allocator.go b/cmd/otel-allocator/internal/allocation/allocator.go
similarity index 99%
rename from cmd/otel-allocator/allocation/allocator.go
rename to cmd/otel-allocator/internal/allocation/allocator.go
index 7fded841..ac630d04 100644
--- a/cmd/otel-allocator/allocation/allocator.go
+++ b/cmd/otel-allocator/internal/allocation/allocator.go
@@ -10,8 +10,8 @@ import (
 	"github.com/go-logr/logr"
 	"github.com/prometheus/client_golang/prometheus"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/diff"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/diff"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 /*
diff --git a/cmd/otel-allocator/allocation/consistent_hashing.go b/cmd/otel-allocator/internal/allocation/consistent_hashing.go
similarity index 98%
rename from cmd/otel-allocator/allocation/consistent_hashing.go
rename to cmd/otel-allocator/internal/allocation/consistent_hashing.go
index a80de494..b0e8229a 100644
--- a/cmd/otel-allocator/allocation/consistent_hashing.go
+++ b/cmd/otel-allocator/internal/allocation/consistent_hashing.go
@@ -9,7 +9,7 @@ import (
 	"github.com/buraksezer/consistent"
 	"github.com/cespare/xxhash/v2"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 const consistentHashingStrategyName = "consistent-hashing"
diff --git a/cmd/otel-allocator/allocation/consistent_hashing_test.go b/cmd/otel-allocator/internal/allocation/consistent_hashing_test.go
similarity index 100%
rename from cmd/otel-allocator/allocation/consistent_hashing_test.go
rename to cmd/otel-allocator/internal/allocation/consistent_hashing_test.go
diff --git a/cmd/otel-allocator/allocation/least_weighted.go b/cmd/otel-allocator/internal/allocation/least_weighted.go
similarity index 98%
rename from cmd/otel-allocator/allocation/least_weighted.go
rename to cmd/otel-allocator/internal/allocation/least_weighted.go
index 9a90477b..16f98673 100644
--- a/cmd/otel-allocator/allocation/least_weighted.go
+++ b/cmd/otel-allocator/internal/allocation/least_weighted.go
@@ -4,7 +4,7 @@
 package allocation
 
 import (
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 const leastWeightedStrategyName = "least-weighted"
diff --git a/cmd/otel-allocator/allocation/least_weighted_test.go b/cmd/otel-allocator/internal/allocation/least_weighted_test.go
similarity index 100%
rename from cmd/otel-allocator/allocation/least_weighted_test.go
rename to cmd/otel-allocator/internal/allocation/least_weighted_test.go
diff --git a/cmd/otel-allocator/allocation/per_node.go b/cmd/otel-allocator/internal/allocation/per_node.go
similarity index 98%
rename from cmd/otel-allocator/allocation/per_node.go
rename to cmd/otel-allocator/internal/allocation/per_node.go
index c78555d1..c5804663 100644
--- a/cmd/otel-allocator/allocation/per_node.go
+++ b/cmd/otel-allocator/internal/allocation/per_node.go
@@ -6,7 +6,7 @@ package allocation
 import (
 	"fmt"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 const perNodeStrategyName = "per-node"
diff --git a/cmd/otel-allocator/allocation/strategy.go b/cmd/otel-allocator/internal/allocation/strategy.go
similarity index 99%
rename from cmd/otel-allocator/allocation/strategy.go
rename to cmd/otel-allocator/internal/allocation/strategy.go
index e724852c..f23e41ec 100644
--- a/cmd/otel-allocator/allocation/strategy.go
+++ b/cmd/otel-allocator/internal/allocation/strategy.go
@@ -11,7 +11,7 @@ import (
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus/promauto"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 type AllocatorProvider func(log logr.Logger, opts ...Option) Allocator
diff --git a/cmd/otel-allocator/collector/collector.go b/cmd/otel-allocator/internal/collector/collector.go
similarity index 99%
rename from cmd/otel-allocator/collector/collector.go
rename to cmd/otel-allocator/internal/collector/collector.go
index b534b6d7..725b5929 100644
--- a/cmd/otel-allocator/collector/collector.go
+++ b/cmd/otel-allocator/internal/collector/collector.go
@@ -17,7 +17,7 @@ import (
 	"k8s.io/client-go/rest"
 	"k8s.io/client-go/tools/cache"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/allocation"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/allocation"
 )
 
 const (
diff --git a/cmd/otel-allocator/config/config.go b/cmd/otel-allocator/internal/config/config.go
similarity index 100%
rename from cmd/otel-allocator/config/config.go
rename to cmd/otel-allocator/internal/config/config.go
diff --git a/cmd/otel-allocator/config/config_test.go b/cmd/otel-allocator/internal/config/config_test.go
similarity index 100%
rename from cmd/otel-allocator/config/config_test.go
rename to cmd/otel-allocator/internal/config/config_test.go
diff --git a/cmd/otel-allocator/config/flags.go b/cmd/otel-allocator/internal/config/flags.go
similarity index 100%
rename from cmd/otel-allocator/config/flags.go
rename to cmd/otel-allocator/internal/config/flags.go
diff --git a/cmd/otel-allocator/config/flags_test.go b/cmd/otel-allocator/internal/config/flags_test.go
similarity index 100%
rename from cmd/otel-allocator/config/flags_test.go
rename to cmd/otel-allocator/internal/config/flags_test.go
diff --git a/cmd/otel-allocator/config/testdata/config_test.yaml b/cmd/otel-allocator/internal/config/testdata/config_test.yaml
similarity index 100%
rename from cmd/otel-allocator/config/testdata/config_test.yaml
rename to cmd/otel-allocator/internal/config/testdata/config_test.yaml
diff --git a/cmd/otel-allocator/config/testdata/file_sd_test.json b/cmd/otel-allocator/internal/config/testdata/file_sd_test.json
similarity index 100%
rename from cmd/otel-allocator/config/testdata/file_sd_test.json
rename to cmd/otel-allocator/internal/config/testdata/file_sd_test.json
diff --git a/cmd/otel-allocator/config/testdata/no_config.yaml b/cmd/otel-allocator/internal/config/testdata/no_config.yaml
similarity index 100%
rename from cmd/otel-allocator/config/testdata/no_config.yaml
rename to cmd/otel-allocator/internal/config/testdata/no_config.yaml
diff --git a/cmd/otel-allocator/config/testdata/pod_service_selector_camelcase_expressions_test.yaml b/cmd/otel-allocator/internal/config/testdata/pod_service_selector_camelcase_expressions_test.yaml
similarity index 100%
rename from cmd/otel-allocator/config/testdata/pod_service_selector_camelcase_expressions_test.yaml
rename to cmd/otel-allocator/internal/config/testdata/pod_service_selector_camelcase_expressions_test.yaml
diff --git a/cmd/otel-allocator/config/testdata/pod_service_selector_camelcase_test.yaml b/cmd/otel-allocator/internal/config/testdata/pod_service_selector_camelcase_test.yaml
similarity index 100%
rename from cmd/otel-allocator/config/testdata/pod_service_selector_camelcase_test.yaml
rename to cmd/otel-allocator/internal/config/testdata/pod_service_selector_camelcase_test.yaml
diff --git a/cmd/otel-allocator/config/testdata/pod_service_selector_expressions_test.yaml b/cmd/otel-allocator/internal/config/testdata/pod_service_selector_expressions_test.yaml
similarity index 100%
rename from cmd/otel-allocator/config/testdata/pod_service_selector_expressions_test.yaml
rename to cmd/otel-allocator/internal/config/testdata/pod_service_selector_expressions_test.yaml
diff --git a/cmd/otel-allocator/config/testdata/pod_service_selector_test.yaml b/cmd/otel-allocator/internal/config/testdata/pod_service_selector_test.yaml
similarity index 100%
rename from cmd/otel-allocator/config/testdata/pod_service_selector_test.yaml
rename to cmd/otel-allocator/internal/config/testdata/pod_service_selector_test.yaml
diff --git a/cmd/otel-allocator/diff/diff.go b/cmd/otel-allocator/internal/diff/diff.go
similarity index 100%
rename from cmd/otel-allocator/diff/diff.go
rename to cmd/otel-allocator/internal/diff/diff.go
diff --git a/cmd/otel-allocator/diff/diff_test.go b/cmd/otel-allocator/internal/diff/diff_test.go
similarity index 100%
rename from cmd/otel-allocator/diff/diff_test.go
rename to cmd/otel-allocator/internal/diff/diff_test.go
diff --git a/cmd/otel-allocator/prehook/prehook.go b/cmd/otel-allocator/internal/prehook/prehook.go
similarity index 97%
rename from cmd/otel-allocator/prehook/prehook.go
rename to cmd/otel-allocator/internal/prehook/prehook.go
index f4cb184c..720c8754 100644
--- a/cmd/otel-allocator/prehook/prehook.go
+++ b/cmd/otel-allocator/internal/prehook/prehook.go
@@ -7,7 +7,7 @@ import (
 	"github.com/go-logr/logr"
 	"github.com/prometheus/prometheus/model/relabel"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 type Hook interface {
diff --git a/cmd/otel-allocator/prehook/relabel.go b/cmd/otel-allocator/internal/prehook/relabel.go
similarity index 99%
rename from cmd/otel-allocator/prehook/relabel.go
rename to cmd/otel-allocator/internal/prehook/relabel.go
index ca92af81..d5dba862 100644
--- a/cmd/otel-allocator/prehook/relabel.go
+++ b/cmd/otel-allocator/internal/prehook/relabel.go
@@ -7,7 +7,7 @@ import (
 	"github.com/go-logr/logr"
 	"github.com/prometheus/prometheus/model/relabel"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 const (
diff --git a/cmd/otel-allocator/server/server.go b/cmd/otel-allocator/internal/server/server.go
similarity index 99%
rename from cmd/otel-allocator/server/server.go
rename to cmd/otel-allocator/internal/server/server.go
index 2dd99c6d..77b43e37 100644
--- a/cmd/otel-allocator/server/server.go
+++ b/cmd/otel-allocator/internal/server/server.go
@@ -26,8 +26,8 @@ import (
 	"github.com/prometheus/prometheus/model/labels"
 	"gopkg.in/yaml.v2"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/allocation"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/allocation"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 var (
diff --git a/cmd/otel-allocator/server/testdata/prom-config-all-actions.yaml b/cmd/otel-allocator/internal/server/testdata/prom-config-all-actions.yaml
similarity index 100%
rename from cmd/otel-allocator/server/testdata/prom-config-all-actions.yaml
rename to cmd/otel-allocator/internal/server/testdata/prom-config-all-actions.yaml
diff --git a/cmd/otel-allocator/server/testdata/prom-config-test.yaml b/cmd/otel-allocator/internal/server/testdata/prom-config-test.yaml
similarity index 100%
rename from cmd/otel-allocator/server/testdata/prom-config-test.yaml
rename to cmd/otel-allocator/internal/server/testdata/prom-config-test.yaml
diff --git a/cmd/otel-allocator/server/testdata/prom-no-config.yaml b/cmd/otel-allocator/internal/server/testdata/prom-no-config.yaml
similarity index 100%
rename from cmd/otel-allocator/server/testdata/prom-no-config.yaml
rename to cmd/otel-allocator/internal/server/testdata/prom-no-config.yaml
diff --git a/cmd/otel-allocator/target/discovery.go b/cmd/otel-allocator/internal/target/discovery.go
similarity index 99%
rename from cmd/otel-allocator/target/discovery.go
rename to cmd/otel-allocator/internal/target/discovery.go
index 3f68408d..9e236d35 100644
--- a/cmd/otel-allocator/target/discovery.go
+++ b/cmd/otel-allocator/internal/target/discovery.go
@@ -21,7 +21,7 @@ import (
 	"go.uber.org/zap/zapcore"
 	"gopkg.in/yaml.v3"
 
-	allocatorWatcher "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/watcher"
+	allocatorWatcher "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/watcher"
 )
 
 var (
diff --git a/cmd/otel-allocator/target/target.go b/cmd/otel-allocator/internal/target/target.go
similarity index 100%
rename from cmd/otel-allocator/target/target.go
rename to cmd/otel-allocator/internal/target/target.go
diff --git a/cmd/otel-allocator/target/testdata/test.yaml b/cmd/otel-allocator/internal/target/testdata/test.yaml
similarity index 100%
rename from cmd/otel-allocator/target/testdata/test.yaml
rename to cmd/otel-allocator/internal/target/testdata/test.yaml
diff --git a/cmd/otel-allocator/target/testdata/test_update.yaml b/cmd/otel-allocator/internal/target/testdata/test_update.yaml
similarity index 100%
rename from cmd/otel-allocator/target/testdata/test_update.yaml
rename to cmd/otel-allocator/internal/target/testdata/test_update.yaml
diff --git a/cmd/otel-allocator/watcher/promOperator.go b/cmd/otel-allocator/internal/watcher/promOperator.go
similarity index 99%
rename from cmd/otel-allocator/watcher/promOperator.go
rename to cmd/otel-allocator/internal/watcher/promOperator.go
index 1a51cb1e..74eef25a 100644
--- a/cmd/otel-allocator/watcher/promOperator.go
+++ b/cmd/otel-allocator/internal/watcher/promOperator.go
@@ -33,7 +33,7 @@ import (
 	"k8s.io/client-go/tools/cache"
 	"k8s.io/client-go/util/retry"
 
-	allocatorconfig "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/config"
+	allocatorconfig "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/config"
 )
 
 const (
diff --git a/cmd/otel-allocator/watcher/watcher.go b/cmd/otel-allocator/internal/watcher/watcher.go
similarity index 100%
rename from cmd/otel-allocator/watcher/watcher.go
rename to cmd/otel-allocator/internal/watcher/watcher.go
diff --git a/cmd/otel-allocator/main.go b/cmd/otel-allocator/main.go
index f9b078dd..90a6b488 100644
--- a/cmd/otel-allocator/main.go
+++ b/cmd/otel-allocator/main.go
@@ -18,13 +18,13 @@ import (
 	_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
 	ctrl "sigs.k8s.io/controller-runtime"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/allocation"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/collector"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/config"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/prehook"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/server"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
-	allocatorWatcher "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/watcher"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/allocation"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/collector"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/config"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/prehook"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/server"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
+	allocatorWatcher "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/watcher"
 )
 
 var (
diff --git a/controllers/targetallocator_controller.go b/controllers/targetallocator_controller.go
index 9612ea94..2699c6fe 100644
--- a/controllers/targetallocator_controller.go
+++ b/controllers/targetallocator_controller.go
@@ -28,6 +28,7 @@ import (
 
 	"github.com/open-telemetry/opentelemetry-operator/apis/v1alpha1"
 	"github.com/open-telemetry/opentelemetry-operator/apis/v1beta1"
+	"github.com/open-telemetry/opentelemetry-operator/internal/autodetect/prometheus"
 	"github.com/open-telemetry/opentelemetry-operator/internal/config"
 	"github.com/open-telemetry/opentelemetry-operator/internal/manifests/targetallocator"
 	taStatus "github.com/open-telemetry/opentelemetry-operator/internal/status/targetallocator"
@@ -190,7 +191,7 @@ func (r *TargetAllocatorReconciler) SetupWithManager(mgr ctrl.Manager) error {
 		Owns(&appsv1.Deployment{}).
 		Owns(&policyV1.PodDisruptionBudget{})
 
-	if featuregate.PrometheusOperatorIsAvailable.IsEnabled() {
+	if featuregate.PrometheusOperatorIsAvailable.IsEnabled() && r.config.PrometheusCRAvailability() == prometheus.Available {
 		ctrlBuilder.Owns(&monitoringv1.ServiceMonitor{})
 		ctrlBuilder.Owns(&monitoringv1.PodMonitor{})
 	}
diff --git a/docs/compatibility.md b/docs/compatibility.md
index e9ab9895..2235e9ce 100644
--- a/docs/compatibility.md
+++ b/docs/compatibility.md
@@ -46,6 +46,7 @@ The OpenTelemetry Operator _might_ work on versions outside of the given range,
 
 | OpenTelemetry Operator | Kubernetes     | Cert-Manager | Prometheus-Operator |
 |------------------------|----------------|--------------|---------------------|
+| v0.119.0               | v1.23 to v1.32 | v1           | v0.76.2             |
 | v0.118.0               | v1.23 to v1.32 | v1           | v0.76.2             |
 | v0.117.0               | v1.23 to v1.32 | v1           | v0.76.2             |
 | v0.116.0               | v1.23 to v1.31 | v1           | v0.76.2             |
@@ -70,7 +71,6 @@ The OpenTelemetry Operator _might_ work on versions outside of the given range,
 | v0.97.0                | v1.23 to v1.29 | v1           | v0.71.2             |
 | v0.96.0                | v1.23 to v1.29 | v1           | v0.71.2             |
 | v0.95.0                | v1.23 to v1.29 | v1           | v0.71.2             |
-| v0.94.0                | v1.23 to v1.29 | v1           | v0.71.0             |
 
 [kubernetes_releases]: https://kubernetes.io/releases/
 [openshift_support]: https://access.redhat.com/support/policy/updates/openshift
diff --git a/go.mod b/go.mod
index b8a19d92..d5ca40be 100644
--- a/go.mod
+++ b/go.mod
@@ -22,17 +22,17 @@ require (
 	github.com/open-telemetry/opamp-go v0.15.0
 	github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e
 	github.com/operator-framework/api v0.29.0
-	github.com/operator-framework/operator-lib v0.16.0
+	github.com/operator-framework/operator-lib v0.17.0
 	github.com/prometheus-operator/prometheus-operator v0.76.2
 	github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.76.2
 	github.com/prometheus-operator/prometheus-operator/pkg/client v0.76.2
-	github.com/prometheus/client_golang v1.20.5
+	github.com/prometheus/client_golang v1.21.0
 	github.com/prometheus/common v0.62.0
 	github.com/prometheus/prometheus v0.55.1
 	github.com/shirou/gopsutil v3.21.11+incompatible
-	github.com/spf13/pflag v1.0.5
+	github.com/spf13/pflag v1.0.6
 	github.com/stretchr/testify v1.10.0
-	go.opentelemetry.io/collector/featuregate v1.25.0
+	go.opentelemetry.io/collector/featuregate v1.26.0
 	go.opentelemetry.io/otel v1.34.0
 	go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0
 	go.opentelemetry.io/otel/exporters/prometheus v0.56.0
@@ -153,7 +153,7 @@ require (
 	github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 // indirect
 	github.com/josharian/intern v1.0.0 // indirect
 	github.com/jpillora/backoff v1.0.0 // indirect
-	github.com/klauspost/compress v1.17.9 // indirect
+	github.com/klauspost/compress v1.17.11 // indirect
 	github.com/klauspost/cpuid/v2 v2.2.8 // indirect
 	github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b // indirect
 	github.com/kylelemons/godebug v1.1.0 // indirect
diff --git a/go.sum b/go.sum
index 8b52e4a7..3da26167 100644
--- a/go.sum
+++ b/go.sum
@@ -417,8 +417,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
 github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
 github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
-github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
+github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
+github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
 github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
 github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM=
 github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
@@ -513,8 +513,8 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+
 github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
 github.com/operator-framework/api v0.29.0 h1:TxAR8RCO+I4FjRrY4PSMgnlmbxNWeD8pzHXp7xwHNmw=
 github.com/operator-framework/api v0.29.0/go.mod h1:0whQE4mpMDd2zyHkQe+bFa3DLoRs6oGWCbu8dY/3pyc=
-github.com/operator-framework/operator-lib v0.16.0 h1:nVMdOGETGK/aBRfFwrxJBIWhyOCduFhPIEOwS2j6F1U=
-github.com/operator-framework/operator-lib v0.16.0/go.mod h1:DyiABYNFJn2cUfVihuhjWYfQMFkW5SDAHEINPRMz0x0=
+github.com/operator-framework/operator-lib v0.17.0 h1:cbz51wZ9+GpWR1ZYP4CSKSSBxDlWxmmnseaHVZZjZt4=
+github.com/operator-framework/operator-lib v0.17.0/go.mod h1:TGopBxIE8L6E/Cojzo26R3NFp1eNlqhQNmzqhOblaLw=
 github.com/ovh/go-ovh v1.6.0 h1:ixLOwxQdzYDx296sXcgS35TOPEahJkpjMGtzPadCjQI=
 github.com/ovh/go-ovh v1.6.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c=
 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
@@ -551,8 +551,8 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O
 github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
 github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
 github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
-github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
-github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
+github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA=
+github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg=
 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -597,8 +597,9 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
 github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
 github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
 github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
-github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
 github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
+github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
@@ -649,8 +650,8 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
 go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
 go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
 go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
-go.opentelemetry.io/collector/featuregate v1.25.0 h1:3b857fvoY9xBcE5qtLUE1/nlQ65teuW9d8CKr6MykYc=
-go.opentelemetry.io/collector/featuregate v1.25.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg=
+go.opentelemetry.io/collector/featuregate v1.26.0 h1:NIZdJby6jL9tEHI25ddeUNgc09Q0Fof31YHF1CSVp4Y=
+go.opentelemetry.io/collector/featuregate v1.26.0/go.mod h1:Y/KsHbvREENKvvN9RlpiWk/IGBK+CATBYzIIpU7nccc=
 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk=
 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8=
 go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
diff --git a/versions.txt b/versions.txt
index ec212ab6..69aebcfe 100644
--- a/versions.txt
+++ b/versions.txt
@@ -2,16 +2,16 @@
 # by default with the OpenTelemetry Operator. This would usually be the latest
 # stable OpenTelemetry version. When you update this file, make sure to update the
 # the docs as well.
-opentelemetry-collector=0.118.0
+opentelemetry-collector=0.119.0
 
 # Represents the current release of the OpenTelemetry Operator.
-operator=0.118.0
+operator=0.119.0
 
 # Represents the current release of the Target Allocator.
-targetallocator=0.118.0
+targetallocator=0.119.0
 
 # Represents the current release of the Operator OpAMP Bridge.
-operator-opamp-bridge=0.118.0
+operator-opamp-bridge=0.119.0
 
 # Represents the current release of Java instrumentation.
 # Should match autoinstrumentation/java/version.txt
@@ -23,7 +23,7 @@ autoinstrumentation-nodejs=0.53.0
 
 # Represents the current release of Python instrumentation.
 # Should match value in autoinstrumentation/python/requirements.txt
-autoinstrumentation-python=0.50b0
+autoinstrumentation-python=0.51b0
 
 # Represents the current release of DotNet instrumentation.
 # Should match autoinstrumentation/dotnet/version.txt


Test patch:
diff --git a/cmd/otel-allocator/benchmark_test.go b/cmd/otel-allocator/benchmark_test.go
index c233f0ce..09e2ffcc 100644
--- a/cmd/otel-allocator/benchmark_test.go
+++ b/cmd/otel-allocator/benchmark_test.go
@@ -22,10 +22,10 @@ import (
 	ctrl "sigs.k8s.io/controller-runtime"
 	"sigs.k8s.io/controller-runtime/pkg/log"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/allocation"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/prehook"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/server"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/allocation"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/prehook"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/server"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 // BenchmarkProcessTargets benchmarks the whole target allocation pipeline. It starts with data the prometheus
diff --git a/cmd/otel-allocator/allocation/allocator_test.go b/cmd/otel-allocator/internal/allocation/allocator_test.go
similarity index 99%
rename from cmd/otel-allocator/allocation/allocator_test.go
rename to cmd/otel-allocator/internal/allocation/allocator_test.go
index 2b361b1e..a18030e0 100644
--- a/cmd/otel-allocator/allocation/allocator_test.go
+++ b/cmd/otel-allocator/internal/allocation/allocator_test.go
@@ -9,7 +9,7 @@ import (
 	"github.com/prometheus/prometheus/model/labels"
 	"github.com/stretchr/testify/assert"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 func TestSetCollectors(t *testing.T) {
diff --git a/cmd/otel-allocator/allocation/per_node_test.go b/cmd/otel-allocator/internal/allocation/per_node_test.go
similarity index 99%
rename from cmd/otel-allocator/allocation/per_node_test.go
rename to cmd/otel-allocator/internal/allocation/per_node_test.go
index 8717bc5c..d610d21c 100644
--- a/cmd/otel-allocator/allocation/per_node_test.go
+++ b/cmd/otel-allocator/internal/allocation/per_node_test.go
@@ -10,7 +10,7 @@ import (
 	"github.com/stretchr/testify/assert"
 	logf "sigs.k8s.io/controller-runtime/pkg/log"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 var loggerPerNode = logf.Log.WithName("unit-tests")
diff --git a/cmd/otel-allocator/allocation/strategy_test.go b/cmd/otel-allocator/internal/allocation/strategy_test.go
similarity index 99%
rename from cmd/otel-allocator/allocation/strategy_test.go
rename to cmd/otel-allocator/internal/allocation/strategy_test.go
index 06da7628..b8e4cca9 100644
--- a/cmd/otel-allocator/allocation/strategy_test.go
+++ b/cmd/otel-allocator/internal/allocation/strategy_test.go
@@ -8,7 +8,7 @@ import (
 	"reflect"
 	"testing"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/diff"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/diff"
 )
 
 func BenchmarkGetAllTargetsByCollectorAndJob(b *testing.B) {
diff --git a/cmd/otel-allocator/allocation/testutils.go b/cmd/otel-allocator/internal/allocation/testutils.go
similarity index 99%
rename from cmd/otel-allocator/allocation/testutils.go
rename to cmd/otel-allocator/internal/allocation/testutils.go
index 0aca5239..93a9fc08 100644
--- a/cmd/otel-allocator/allocation/testutils.go
+++ b/cmd/otel-allocator/internal/allocation/testutils.go
@@ -14,7 +14,7 @@ import (
 	"github.com/stretchr/testify/require"
 	logf "sigs.k8s.io/controller-runtime/pkg/log"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 func colIndex(index, numCols int) int {
diff --git a/cmd/otel-allocator/collector/collector_test.go b/cmd/otel-allocator/internal/collector/collector_test.go
similarity index 99%
rename from cmd/otel-allocator/collector/collector_test.go
rename to cmd/otel-allocator/internal/collector/collector_test.go
index 8b7f3c5d..efcb26ae 100644
--- a/cmd/otel-allocator/collector/collector_test.go
+++ b/cmd/otel-allocator/internal/collector/collector_test.go
@@ -17,7 +17,7 @@ import (
 	"k8s.io/client-go/kubernetes/fake"
 	logf "sigs.k8s.io/controller-runtime/pkg/log"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/allocation"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/allocation"
 )
 
 var logger = logf.Log.WithName("collector-unit-tests")
diff --git a/cmd/otel-allocator/prehook/relabel_test.go b/cmd/otel-allocator/internal/prehook/relabel_test.go
similarity index 99%
rename from cmd/otel-allocator/prehook/relabel_test.go
rename to cmd/otel-allocator/internal/prehook/relabel_test.go
index 50154e1f..792b3b3a 100644
--- a/cmd/otel-allocator/prehook/relabel_test.go
+++ b/cmd/otel-allocator/internal/prehook/relabel_test.go
@@ -16,7 +16,7 @@ import (
 	"github.com/stretchr/testify/assert"
 	logf "sigs.k8s.io/controller-runtime/pkg/log"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 var (
diff --git a/cmd/otel-allocator/server/bench_test.go b/cmd/otel-allocator/internal/server/bench_test.go
similarity index 99%
rename from cmd/otel-allocator/server/bench_test.go
rename to cmd/otel-allocator/internal/server/bench_test.go
index d28dfa26..98b88c0f 100644
--- a/cmd/otel-allocator/server/bench_test.go
+++ b/cmd/otel-allocator/internal/server/bench_test.go
@@ -16,8 +16,8 @@ import (
 	"github.com/prometheus/prometheus/model/labels"
 	"github.com/stretchr/testify/assert"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/allocation"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/allocation"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 func BenchmarkServerTargetsHandler(b *testing.B) {
diff --git a/cmd/otel-allocator/server/mocks_test.go b/cmd/otel-allocator/internal/server/mocks_test.go
similarity index 95%
rename from cmd/otel-allocator/server/mocks_test.go
rename to cmd/otel-allocator/internal/server/mocks_test.go
index 20db0839..ec607bdf 100644
--- a/cmd/otel-allocator/server/mocks_test.go
+++ b/cmd/otel-allocator/internal/server/mocks_test.go
@@ -4,8 +4,8 @@
 package server
 
 import (
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/allocation"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/allocation"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 var _ allocation.Allocator = &mockAllocator{}
diff --git a/cmd/otel-allocator/server/server_test.go b/cmd/otel-allocator/internal/server/server_test.go
similarity index 99%
rename from cmd/otel-allocator/server/server_test.go
rename to cmd/otel-allocator/internal/server/server_test.go
index 7567320f..fce2ef0c 100644
--- a/cmd/otel-allocator/server/server_test.go
+++ b/cmd/otel-allocator/internal/server/server_test.go
@@ -24,9 +24,9 @@ import (
 	"gopkg.in/yaml.v2"
 	logf "sigs.k8s.io/controller-runtime/pkg/log"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/allocation"
-	allocatorconfig "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/config"
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/target"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/allocation"
+	allocatorconfig "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/config"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/target"
 )
 
 var (
diff --git a/cmd/otel-allocator/target/discovery_test.go b/cmd/otel-allocator/internal/target/discovery_test.go
similarity index 99%
rename from cmd/otel-allocator/target/discovery_test.go
rename to cmd/otel-allocator/internal/target/discovery_test.go
index 977c2a58..c05d2a13 100644
--- a/cmd/otel-allocator/target/discovery_test.go
+++ b/cmd/otel-allocator/internal/target/discovery_test.go
@@ -22,8 +22,8 @@ import (
 	"github.com/stretchr/testify/require"
 	ctrl "sigs.k8s.io/controller-runtime"
 
-	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/config"
-	allocatorWatcher "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/watcher"
+	"github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/config"
+	allocatorWatcher "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/watcher"
 )
 
 var defaultScrapeProtocols = []promconfig.ScrapeProtocol{
diff --git a/cmd/otel-allocator/watcher/promOperator_test.go b/cmd/otel-allocator/internal/watcher/promOperator_test.go
similarity index 99%
rename from cmd/otel-allocator/watcher/promOperator_test.go
rename to cmd/otel-allocator/internal/watcher/promOperator_test.go
index fa71436b..b3d4d15f 100644
--- a/cmd/otel-allocator/watcher/promOperator_test.go
+++ b/cmd/otel-allocator/internal/watcher/promOperator_test.go
@@ -35,7 +35,7 @@ import (
 	fcache "k8s.io/client-go/tools/cache/testing"
 	"k8s.io/utils/ptr"
 
-	allocatorconfig "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/config"
+	allocatorconfig "github.com/open-telemetry/opentelemetry-operator/cmd/otel-allocator/internal/config"
 )
 
 var defaultScrapeProtocols = []promconfig.ScrapeProtocol{
diff --git a/controllers/reconcile_test.go b/controllers/reconcile_test.go
index 82904559..4737092a 100644
--- a/controllers/reconcile_test.go
+++ b/controllers/reconcile_test.go
@@ -1362,7 +1362,7 @@ func createTestReconciler(t *testing.T, ctx context.Context, cfg config.Config)
 	require.NoError(t, err)
 	go func() {
 		startErr := runtimeCluster.Start(ctx)
-		require.NoError(t, startErr)
+		assert.NoError(t, startErr)
 	}()
 
 	cacheClient := runtimeCluster.GetClient()
@@ -1375,6 +1375,8 @@ func createTestReconciler(t *testing.T, ctx context.Context, cfg config.Config)
 	})
 	err = reconciler.SetupCaches(runtimeCluster)
 	require.NoError(t, err)
+	synced := runtimeCluster.GetCache().WaitForCacheSync(ctx)
+	require.True(t, synced, "caches didn't sync successfully")
 	return reconciler
 }