From 3f2944a23ab3dc97ab6d923c9c07eeab62bbe1fd Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Sun, 19 Jan 2025 16:44:54 -0800 Subject: [PATCH] [chore] move all target-allocator code to internal --- cmd/otel-allocator/benchmark_test.go | 8 ++++---- .../{ => internal}/allocation/allocator.go | 4 ++-- .../{ => internal}/allocation/allocator_test.go | 2 +- .../allocation/consistent_hashing.go | 2 +- .../allocation/consistent_hashing_test.go | 0 .../{ => internal}/allocation/least_weighted.go | 2 +- .../allocation/least_weighted_test.go | 0 .../{ => internal}/allocation/per_node.go | 2 +- .../{ => internal}/allocation/per_node_test.go | 2 +- .../{ => internal}/allocation/strategy.go | 2 +- .../{ => internal}/allocation/strategy_test.go | 2 +- .../{ => internal}/allocation/testutils.go | 2 +- .../{ => internal}/collector/collector.go | 2 +- .../{ => internal}/collector/collector_test.go | 2 +- cmd/otel-allocator/{ => internal}/config/config.go | 0 .../{ => internal}/config/config_test.go | 0 cmd/otel-allocator/{ => internal}/config/flags.go | 0 .../{ => internal}/config/flags_test.go | 0 .../config/testdata/config_test.yaml | 0 .../config/testdata/file_sd_test.json | 0 .../{ => internal}/config/testdata/no_config.yaml | 0 .../config/testdata/pod_service_selector_test.yaml | 0 cmd/otel-allocator/{ => internal}/diff/diff.go | 0 .../{ => internal}/diff/diff_test.go | 0 .../{ => internal}/prehook/prehook.go | 2 +- .../{ => internal}/prehook/relabel.go | 2 +- .../{ => internal}/prehook/relabel_test.go | 2 +- .../{ => internal}/server/bench_test.go | 4 ++-- .../{ => internal}/server/mocks_test.go | 4 ++-- cmd/otel-allocator/{ => internal}/server/server.go | 4 ++-- .../{ => internal}/server/server_test.go | 6 +++--- .../server/testdata/prom-config-all-actions.yaml | 0 .../server/testdata/prom-config-test.yaml | 0 .../server/testdata/prom-no-config.yaml | 0 .../{ => internal}/target/discovery.go | 2 +- .../{ => internal}/target/discovery_test.go | 4 ++-- cmd/otel-allocator/{ => internal}/target/target.go | 0 .../{ => internal}/target/testdata/test.yaml | 0 .../target/testdata/test_update.yaml | 0 .../{ => internal}/watcher/promOperator.go | 2 +- .../{ => internal}/watcher/promOperator_test.go | 2 +- .../{ => internal}/watcher/watcher.go | 0 cmd/otel-allocator/main.go | 14 +++++++------- 43 files changed, 40 insertions(+), 40 deletions(-) rename cmd/otel-allocator/{ => internal}/allocation/allocator.go (99%) rename cmd/otel-allocator/{ => internal}/allocation/allocator_test.go (99%) rename cmd/otel-allocator/{ => internal}/allocation/consistent_hashing.go (99%) rename cmd/otel-allocator/{ => internal}/allocation/consistent_hashing_test.go (100%) rename cmd/otel-allocator/{ => internal}/allocation/least_weighted.go (98%) rename cmd/otel-allocator/{ => internal}/allocation/least_weighted_test.go (100%) rename cmd/otel-allocator/{ => internal}/allocation/per_node.go (98%) rename cmd/otel-allocator/{ => internal}/allocation/per_node_test.go (99%) rename cmd/otel-allocator/{ => internal}/allocation/strategy.go (99%) rename cmd/otel-allocator/{ => internal}/allocation/strategy_test.go (99%) rename cmd/otel-allocator/{ => internal}/allocation/testutils.go (99%) rename cmd/otel-allocator/{ => internal}/collector/collector.go (99%) rename cmd/otel-allocator/{ => internal}/collector/collector_test.go (99%) rename cmd/otel-allocator/{ => internal}/config/config.go (100%) rename cmd/otel-allocator/{ => internal}/config/config_test.go (100%) rename cmd/otel-allocator/{ => internal}/config/flags.go (100%) rename cmd/otel-allocator/{ => internal}/config/flags_test.go (100%) rename cmd/otel-allocator/{ => internal}/config/testdata/config_test.yaml (100%) rename cmd/otel-allocator/{ => internal}/config/testdata/file_sd_test.json (100%) rename cmd/otel-allocator/{ => internal}/config/testdata/no_config.yaml (100%) rename cmd/otel-allocator/{ => internal}/config/testdata/pod_service_selector_test.yaml (100%) rename cmd/otel-allocator/{ => internal}/diff/diff.go (100%) rename cmd/otel-allocator/{ => internal}/diff/diff_test.go (100%) rename cmd/otel-allocator/{ => internal}/prehook/prehook.go (98%) rename cmd/otel-allocator/{ => internal}/prehook/relabel.go (99%) rename cmd/otel-allocator/{ => internal}/prehook/relabel_test.go (99%) rename cmd/otel-allocator/{ => internal}/server/bench_test.go (99%) rename cmd/otel-allocator/{ => internal}/server/mocks_test.go (97%) rename cmd/otel-allocator/{ => internal}/server/server.go (99%) rename cmd/otel-allocator/{ => internal}/server/server_test.go (99%) rename cmd/otel-allocator/{ => internal}/server/testdata/prom-config-all-actions.yaml (100%) rename cmd/otel-allocator/{ => internal}/server/testdata/prom-config-test.yaml (100%) rename cmd/otel-allocator/{ => internal}/server/testdata/prom-no-config.yaml (100%) rename cmd/otel-allocator/{ => internal}/target/discovery.go (99%) rename cmd/otel-allocator/{ => internal}/target/discovery_test.go (99%) rename cmd/otel-allocator/{ => internal}/target/target.go (100%) rename cmd/otel-allocator/{ => internal}/target/testdata/test.yaml (100%) rename cmd/otel-allocator/{ => internal}/target/testdata/test_update.yaml (100%) rename cmd/otel-allocator/{ => internal}/watcher/promOperator.go (99%) rename cmd/otel-allocator/{ => internal}/watcher/promOperator_test.go (99%) rename cmd/otel-allocator/{ => internal}/watcher/watcher.go (100%) diff --git a/cmd/otel-allocator/benchmark_test.go b/cmd/otel-allocator/benchmark_test.go index 0fc486d5f6..c4c5ee5761 100644 --- a/cmd/otel-allocator/benchmark_test.go +++ b/cmd/otel-allocator/benchmark_test.go @@ -33,10 +33,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.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 b0a9125ba9..e252934263 100644 --- a/cmd/otel-allocator/allocation/allocator.go +++ b/cmd/otel-allocator/internal/allocation/allocator.go @@ -21,8 +21,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/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 e6c2b9693a..7580a3de18 100644 --- a/cmd/otel-allocator/allocation/allocator_test.go +++ b/cmd/otel-allocator/internal/allocation/allocator_test.go @@ -20,7 +20,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/consistent_hashing.go b/cmd/otel-allocator/internal/allocation/consistent_hashing.go similarity index 99% rename from cmd/otel-allocator/allocation/consistent_hashing.go rename to cmd/otel-allocator/internal/allocation/consistent_hashing.go index c8a16903bc..95cea627a6 100644 --- a/cmd/otel-allocator/allocation/consistent_hashing.go +++ b/cmd/otel-allocator/internal/allocation/consistent_hashing.go @@ -20,7 +20,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 49d935715d..c421beda37 100644 --- a/cmd/otel-allocator/allocation/least_weighted.go +++ b/cmd/otel-allocator/internal/allocation/least_weighted.go @@ -15,7 +15,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 3d9c76d90d..2eea4fa3d9 100644 --- a/cmd/otel-allocator/allocation/per_node.go +++ b/cmd/otel-allocator/internal/allocation/per_node.go @@ -17,7 +17,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/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 4d17e6bbb3..e0eabd2799 100644 --- a/cmd/otel-allocator/allocation/per_node_test.go +++ b/cmd/otel-allocator/internal/allocation/per_node_test.go @@ -21,7 +21,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.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 35394d0f8c..470070cdd2 100644 --- a/cmd/otel-allocator/allocation/strategy.go +++ b/cmd/otel-allocator/internal/allocation/strategy.go @@ -23,7 +23,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 ...AllocationOption) Allocator 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 10c61f5365..b59ba9924a 100644 --- a/cmd/otel-allocator/allocation/strategy_test.go +++ b/cmd/otel-allocator/internal/allocation/strategy_test.go @@ -19,7 +19,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 3189b576c1..d94ca39068 100644 --- a/cmd/otel-allocator/allocation/testutils.go +++ b/cmd/otel-allocator/internal/allocation/testutils.go @@ -25,7 +25,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.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 8814e38797..251227f10a 100644 --- a/cmd/otel-allocator/collector/collector.go +++ b/cmd/otel-allocator/internal/collector/collector.go @@ -28,7 +28,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/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 ed5ac364fc..c8924524f0 100644 --- a/cmd/otel-allocator/collector/collector_test.go +++ b/cmd/otel-allocator/internal/collector/collector_test.go @@ -28,7 +28,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/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_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 98% rename from cmd/otel-allocator/prehook/prehook.go rename to cmd/otel-allocator/internal/prehook/prehook.go index f356f7c2d8..752e8fb436 100644 --- a/cmd/otel-allocator/prehook/prehook.go +++ b/cmd/otel-allocator/internal/prehook/prehook.go @@ -20,7 +20,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/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 6c96affa39..2337a6fc97 100644 --- a/cmd/otel-allocator/prehook/relabel.go +++ b/cmd/otel-allocator/internal/prehook/relabel.go @@ -18,7 +18,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 RelabelConfigTargetFilter struct { 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 9aa27764ca..e46be20d8e 100644 --- a/cmd/otel-allocator/prehook/relabel_test.go +++ b/cmd/otel-allocator/internal/prehook/relabel_test.go @@ -27,7 +27,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 d441fd8e2c..115ec4e557 100644 --- a/cmd/otel-allocator/server/bench_test.go +++ b/cmd/otel-allocator/internal/server/bench_test.go @@ -27,8 +27,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 97% rename from cmd/otel-allocator/server/mocks_test.go rename to cmd/otel-allocator/internal/server/mocks_test.go index 8620d70367..3611babcf3 100644 --- a/cmd/otel-allocator/server/mocks_test.go +++ b/cmd/otel-allocator/internal/server/mocks_test.go @@ -15,8 +15,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.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 2e9df9a8b0..100d45e0fe 100644 --- a/cmd/otel-allocator/server/server.go +++ b/cmd/otel-allocator/internal/server/server.go @@ -38,8 +38,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/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 4bc403251c..ad70dd31ed 100644 --- a/cmd/otel-allocator/server/server_test.go +++ b/cmd/otel-allocator/internal/server/server_test.go @@ -35,9 +35,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/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 6f2ddc931b..e7f9789a82 100644 --- a/cmd/otel-allocator/target/discovery.go +++ b/cmd/otel-allocator/internal/target/discovery.go @@ -32,7 +32,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/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 c53228f072..d341052357 100644 --- a/cmd/otel-allocator/target/discovery_test.go +++ b/cmd/otel-allocator/internal/target/discovery_test.go @@ -33,8 +33,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/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 517f065ff3..bbbd949c64 100644 --- a/cmd/otel-allocator/watcher/promOperator.go +++ b/cmd/otel-allocator/internal/watcher/promOperator.go @@ -44,7 +44,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/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 3cc959046e..67c81473d2 100644 --- a/cmd/otel-allocator/watcher/promOperator_test.go +++ b/cmd/otel-allocator/internal/watcher/promOperator_test.go @@ -46,7 +46,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/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 eff7502dcd..e665780473 100644 --- a/cmd/otel-allocator/main.go +++ b/cmd/otel-allocator/main.go @@ -29,13 +29,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 (