diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e1010b465647..3912021f1468 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -131,7 +131,6 @@ internal/exp/metrics/ @open-telemetry/collector-cont internal/filter/ @open-telemetry/collector-contrib-approvers @open-telemetry/collector-approvers internal/grpcutil/ @open-telemetry/collector-contrib-approvers @jmacd @moh-osman3 @lquerel internal/k8sconfig/ @open-telemetry/collector-contrib-approvers @dmitryax -internal/k8stest/ @open-telemetry/collector-contrib-approvers @crobert-1 internal/kafka/ @open-telemetry/collector-contrib-approvers @pavolloffay @MovieStoreGuy internal/kubelet/ @open-telemetry/collector-contrib-approvers @dmitryax internal/metadataproviders/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @dashpole @@ -148,6 +147,7 @@ pkg/batchpersignal/ @open-telemetry/collector-cont pkg/datadog/ @open-telemetry/collector-contrib-approvers @mx-psi @dineshg13 @liustanley @songy23 @mackjmr @ankitpatel96 @jade-guiton-dd pkg/experimentalmetricmetadata/ @open-telemetry/collector-contrib-approvers @dmitryax pkg/golden/ @open-telemetry/collector-contrib-approvers @djaglowski @atoulme +pkg/k8stest/ @open-telemetry/collector-contrib-approvers @crobert-1 pkg/kafka/topic/ @open-telemetry/collector-contrib-approvers @pavolloffay @MovieStoreGuy pkg/ottl/ @open-telemetry/collector-contrib-approvers @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley @edmocosta pkg/pdatatest/ @open-telemetry/collector-contrib-approvers @djaglowski @fatsheep9146 diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index ea469c572bcb..53db25c4e253 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -131,7 +131,6 @@ body: - internal/filter - internal/grpcutil - internal/k8sconfig - - internal/k8stest - internal/kafka - internal/kubelet - internal/metadataproviders @@ -147,6 +146,7 @@ body: - pkg/datadog - pkg/experimentalmetricmetadata - pkg/golden + - pkg/k8stest - pkg/kafka/topic - pkg/ottl - pkg/pdatatest diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 99f72f1c13b1..9d5de87d4142 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -125,7 +125,6 @@ body: - internal/filter - internal/grpcutil - internal/k8sconfig - - internal/k8stest - internal/kafka - internal/kubelet - internal/metadataproviders @@ -141,6 +140,7 @@ body: - pkg/datadog - pkg/experimentalmetricmetadata - pkg/golden + - pkg/k8stest - pkg/kafka/topic - pkg/ottl - pkg/pdatatest diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index c65b1b3fa089..e4c62b6cfbd2 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -125,7 +125,6 @@ body: - internal/filter - internal/grpcutil - internal/k8sconfig - - internal/k8stest - internal/kafka - internal/kubelet - internal/metadataproviders @@ -141,6 +140,7 @@ body: - pkg/datadog - pkg/experimentalmetricmetadata - pkg/golden + - pkg/k8stest - pkg/kafka/topic - pkg/ottl - pkg/pdatatest diff --git a/.github/ISSUE_TEMPLATE/unmaintained.yaml b/.github/ISSUE_TEMPLATE/unmaintained.yaml index a6402ed0e246..c78636f13eb9 100644 --- a/.github/ISSUE_TEMPLATE/unmaintained.yaml +++ b/.github/ISSUE_TEMPLATE/unmaintained.yaml @@ -130,7 +130,6 @@ body: - internal/filter - internal/grpcutil - internal/k8sconfig - - internal/k8stest - internal/kafka - internal/kubelet - internal/metadataproviders @@ -146,6 +145,7 @@ body: - pkg/datadog - pkg/experimentalmetricmetadata - pkg/golden + - pkg/k8stest - pkg/kafka/topic - pkg/ottl - pkg/pdatatest diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index bff9f514f030..a6ecd01240bf 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -363,7 +363,7 @@ replaces: - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azuremonitorexporter => ../../exporter/azuremonitorexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azuredataexplorerexporter => ../../exporter/azuredataexplorerexporter - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => ../../internal/k8sconfig - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest => ../../internal/k8stest + - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest => ../../pkg/k8stest - github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka => ../../internal/kafka - github.com/open-telemetry/opentelemetry-collector-contrib/internal/rabbitmq => ../../internal/rabbitmq - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver => ../../receiver/carbonreceiver diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index 178a8882096b..512e1b0c8602 100644 --- a/connector/datadogconnector/go.mod +++ b/connector/datadogconnector/go.mod @@ -327,7 +327,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sco replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker => ../../internal/docker -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest => ../../internal/k8stest +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest => ../../pkg/k8stest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry => ../../pkg/resourcetotelemetry diff --git a/exporter/datadogexporter/go.mod b/exporter/datadogexporter/go.mod index 182a985a9333..57ab6dac1f6a 100644 --- a/exporter/datadogexporter/go.mod +++ b/exporter/datadogexporter/go.mod @@ -457,7 +457,7 @@ replace github.com/openshift/api v3.9.0+incompatible => github.com/openshift/api replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest => ../../internal/k8stest +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest => ../../pkg/k8stest replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dockerstatsreceiver => ../../receiver/dockerstatsreceiver diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index d5e470ebd0b9..f3219d741c19 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -434,7 +434,7 @@ replace github.com/openshift/api v3.9.0+incompatible => github.com/openshift/api replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../../pkg/pdatatest -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest => ../../../internal/k8stest +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest => ../../../pkg/k8stest replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dockerstatsreceiver => ../../../receiver/dockerstatsreceiver diff --git a/internal/k8stest/Makefile b/pkg/k8stest/Makefile similarity index 100% rename from internal/k8stest/Makefile rename to pkg/k8stest/Makefile diff --git a/internal/k8stest/README.md b/pkg/k8stest/README.md similarity index 100% rename from internal/k8stest/README.md rename to pkg/k8stest/README.md diff --git a/internal/k8stest/client.go b/pkg/k8stest/client.go similarity index 97% rename from internal/k8stest/client.go rename to pkg/k8stest/client.go index 3de4092c4d51..ba68cc134c09 100644 --- a/internal/k8stest/client.go +++ b/pkg/k8stest/client.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest" +package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest" import ( "errors" diff --git a/internal/k8stest/go.mod b/pkg/k8stest/go.mod similarity index 99% rename from internal/k8stest/go.mod rename to pkg/k8stest/go.mod index 972320658af4..dfd9373af9c2 100644 --- a/internal/k8stest/go.mod +++ b/pkg/k8stest/go.mod @@ -1,4 +1,4 @@ -module github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest +module github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest go 1.22.0 diff --git a/internal/k8stest/go.sum b/pkg/k8stest/go.sum similarity index 100% rename from internal/k8stest/go.sum rename to pkg/k8stest/go.sum diff --git a/internal/k8stest/k8s_collector.go b/pkg/k8stest/k8s_collector.go similarity index 90% rename from internal/k8stest/k8s_collector.go rename to pkg/k8stest/k8s_collector.go index b74257845344..0fbf85d80f7c 100644 --- a/internal/k8stest/k8s_collector.go +++ b/pkg/k8stest/k8s_collector.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest" +package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest" import ( "bytes" @@ -20,15 +20,14 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" ) -func CreateCollectorObjects(t *testing.T, client *K8sClient, testID string, manifestsDir string) []*unstructured.Unstructured { +func CreateCollectorObjects(t *testing.T, client *K8sClient, testID string, manifestsDir string, templateValues map[string]string, host string) []*unstructured.Unstructured { if manifestsDir == "" { manifestsDir = filepath.Join(".", "testdata", "e2e", "collector") } manifestFiles, err := os.ReadDir(manifestsDir) require.NoErrorf(t, err, "failed to read collector manifests directory %s", manifestsDir) - host := HostEndpoint(t) if host == "" { - require.Fail(t, "host endpoint cannot be empty") + host = HostEndpoint(t) } var podNamespace string var podLabels map[string]any @@ -36,11 +35,15 @@ func CreateCollectorObjects(t *testing.T, client *K8sClient, testID string, mani for _, manifestFile := range manifestFiles { tmpl := template.Must(template.New(manifestFile.Name()).ParseFiles(filepath.Join(manifestsDir, manifestFile.Name()))) manifest := &bytes.Buffer{} - require.NoError(t, tmpl.Execute(manifest, map[string]string{ + defaultTemplateValues := map[string]string{ "Name": "otelcol-" + testID, "HostEndpoint": host, "TestID": testID, - })) + } + for key, value := range templateValues { + defaultTemplateValues[key] = value + } + require.NoError(t, tmpl.Execute(manifest, defaultTemplateValues)) obj, err := CreateObject(client, manifest.Bytes()) require.NoErrorf(t, err, "failed to create collector object from manifest %s", manifestFile.Name()) objKind := obj.GetKind() diff --git a/internal/k8stest/k8s_data_helpers.go b/pkg/k8stest/k8s_data_helpers.go similarity index 96% rename from internal/k8stest/k8s_data_helpers.go rename to pkg/k8stest/k8s_data_helpers.go index 09114fd29fcf..8e0c39c790cf 100644 --- a/internal/k8stest/k8s_data_helpers.go +++ b/pkg/k8stest/k8s_data_helpers.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest" +package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest" import ( "context" diff --git a/internal/k8stest/k8s_objects.go b/pkg/k8stest/k8s_objects.go similarity index 98% rename from internal/k8stest/k8s_objects.go rename to pkg/k8stest/k8s_objects.go index a9acca588f84..d89866f945aa 100644 --- a/internal/k8stest/k8s_objects.go +++ b/pkg/k8stest/k8s_objects.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest" +package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest" import ( "context" diff --git a/internal/k8stest/k8s_telemetrygen.go b/pkg/k8stest/k8s_telemetrygen.go similarity index 98% rename from internal/k8stest/k8s_telemetrygen.go rename to pkg/k8stest/k8s_telemetrygen.go index c620d499a333..768e2c55be3d 100644 --- a/internal/k8stest/k8s_telemetrygen.go +++ b/pkg/k8stest/k8s_telemetrygen.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest" +package k8stest // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest" import ( "bytes" diff --git a/internal/k8stest/metadata.yaml b/pkg/k8stest/metadata.yaml similarity index 100% rename from internal/k8stest/metadata.yaml rename to pkg/k8stest/metadata.yaml diff --git a/processor/k8sattributesprocessor/e2e_test.go b/processor/k8sattributesprocessor/e2e_test.go index 147b968ec913..e160a563ceda 100644 --- a/processor/k8sattributesprocessor/e2e_test.go +++ b/processor/k8sattributesprocessor/e2e_test.go @@ -27,7 +27,7 @@ import ( "go.opentelemetry.io/collector/receiver/xreceiver" "go.uber.org/multierr" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest" ) const ( @@ -86,7 +86,7 @@ func TestE2E_ClusterRBAC(t *testing.T) { defer shutdownSinks() testID := uuid.NewString()[:8] - collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(testDir, "collector")) + collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(testDir, "collector"), map[string]string{}, "") createTeleOpts := &k8stest.TelemetrygenCreateOpts{ ManifestsDir: filepath.Join(testDir, "telemetrygen"), TestID: testID, @@ -566,7 +566,7 @@ func TestE2E_NamespacedRBAC(t *testing.T) { defer shutdownSinks() testID := uuid.NewString()[:8] - collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(testDir, "collector")) + collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(testDir, "collector"), map[string]string{}, "") createTeleOpts := &k8stest.TelemetrygenCreateOpts{ ManifestsDir: filepath.Join(testDir, "telemetrygen"), TestID: testID, @@ -742,11 +742,11 @@ func TestE2E_MixRBAC(t *testing.T) { } defer func() { - require.NoErrorf(t, k8stest.DeleteObject(k8sClient, nsObj), "failed to delete namespace %s", nsObj.GetName()) + require.NoErrorf(t, k8stest.DeleteObject(k8sClient, nsObj), "failed to delete namespace %s", nsObj.GetName(), "") }() } - collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(testDir, "collector")) + collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(testDir, "collector"), map[string]string{}, "") defer func() { for _, obj := range collectorObjs { require.NoErrorf(t, k8stest.DeleteObject(k8sClient, obj), "failed to delete object %s", obj.GetName()) @@ -941,7 +941,7 @@ func TestE2E_NamespacedRBACNoPodIP(t *testing.T) { defer shutdownSinks() testID := uuid.NewString()[:8] - collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(testDir, "collector")) + collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(testDir, "collector"), map[string]string{}, "") createTeleOpts := &k8stest.TelemetrygenCreateOpts{ ManifestsDir: filepath.Join(testDir, "telemetrygen"), TestID: testID, diff --git a/processor/k8sattributesprocessor/go.mod b/processor/k8sattributesprocessor/go.mod index 4328926d4d4a..8166f404fe0b 100644 --- a/processor/k8sattributesprocessor/go.mod +++ b/processor/k8sattributesprocessor/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/uuid v1.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.117.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.117.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest v0.117.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/client v1.23.0 go.opentelemetry.io/collector/component v0.117.0 @@ -145,7 +145,7 @@ retract ( replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest => ../../internal/k8stest +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest => ../../pkg/k8stest // ambiguous import: found package cloud.google.com/go/compute/metadata in multiple modules replace cloud.google.com/go v0.54.0 => cloud.google.com/go v0.110.10 diff --git a/receiver/k8sclusterreceiver/e2e_test.go b/receiver/k8sclusterreceiver/e2e_test.go index e7b0bbb024a7..ee8c61082fe4 100644 --- a/receiver/k8sclusterreceiver/e2e_test.go +++ b/receiver/k8sclusterreceiver/e2e_test.go @@ -21,8 +21,8 @@ import ( "go.opentelemetry.io/collector/receiver/otlpreceiver" "go.opentelemetry.io/collector/receiver/receivertest" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" ) @@ -63,7 +63,7 @@ func TestE2EClusterScoped(t *testing.T) { defer shutdownSink() testID := uuid.NewString()[:8] - collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(".", "testdata", "e2e", "cluster-scoped", "collector")) + collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(".", "testdata", "e2e", "cluster-scoped", "collector"), map[string]string{}, "") t.Cleanup(func() { for _, obj := range append(collectorObjs) { @@ -147,7 +147,7 @@ func TestE2ENamespaceScoped(t *testing.T) { defer shutdownSink() testID := uuid.NewString()[:8] - collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(".", "testdata", "e2e", "namespace-scoped", "collector")) + collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, filepath.Join(".", "testdata", "e2e", "namespace-scoped", "collector"), map[string]string{}, "") t.Cleanup(func() { for _, obj := range append(collectorObjs) { diff --git a/receiver/k8sclusterreceiver/go.mod b/receiver/k8sclusterreceiver/go.mod index 0bd965209fda..944cf858f2b8 100644 --- a/receiver/k8sclusterreceiver/go.mod +++ b/receiver/k8sclusterreceiver/go.mod @@ -8,10 +8,10 @@ require ( github.com/iancoleman/strcase v0.3.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.117.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.117.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.117.0 github.com/openshift/api v3.9.0+incompatible github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142 @@ -156,7 +156,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil // openshift removed all tags from their repo, use the pseudoversion from the release-3.9 branch HEAD replace github.com/openshift/api v3.9.0+incompatible => github.com/openshift/api v0.0.0-20180801171038-322a19404e37 -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest => ../../internal/k8stest +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest => ../../pkg/k8stest replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent => ../../internal/sharedcomponent diff --git a/receiver/k8sobjectsreceiver/e2e_test.go b/receiver/k8sobjectsreceiver/e2e_test.go index b7c9c4c54b08..d5e3f69edca1 100644 --- a/receiver/k8sobjectsreceiver/e2e_test.go +++ b/receiver/k8sobjectsreceiver/e2e_test.go @@ -22,8 +22,8 @@ import ( "go.opentelemetry.io/collector/receiver/receivertest" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/plogtest" ) @@ -60,7 +60,7 @@ func TestE2E(t *testing.T) { }() // startup collector in k8s cluster - collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, "") + collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, "", map[string]string{}, "") defer func() { for _, obj := range collectorObjs { diff --git a/receiver/k8sobjectsreceiver/go.mod b/receiver/k8sobjectsreceiver/go.mod index 2fd795211d99..a3c2440f36ec 100644 --- a/receiver/k8sobjectsreceiver/go.mod +++ b/receiver/k8sobjectsreceiver/go.mod @@ -5,8 +5,8 @@ go 1.22.0 require ( github.com/google/uuid v1.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.117.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.117.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.117.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.117.0 @@ -142,7 +142,7 @@ retract ( v0.65.0 ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest => ../../internal/k8stest +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest => ../../pkg/k8stest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/receiver/kubeletstatsreceiver/e2e_test.go b/receiver/kubeletstatsreceiver/e2e_test.go index 3411d2f2b9f2..bfd241a180a3 100644 --- a/receiver/kubeletstatsreceiver/e2e_test.go +++ b/receiver/kubeletstatsreceiver/e2e_test.go @@ -20,8 +20,8 @@ import ( "go.opentelemetry.io/collector/receiver/otlpreceiver" "go.opentelemetry.io/collector/receiver/receivertest" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" ) @@ -41,7 +41,7 @@ func TestE2E(t *testing.T) { defer shutdownSink() testID := uuid.NewString()[:8] - collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, "") + collectorObjs := k8stest.CreateCollectorObjects(t, k8sClient, testID, "", map[string]string{}, "") defer func() { for _, obj := range append(collectorObjs) { diff --git a/receiver/kubeletstatsreceiver/go.mod b/receiver/kubeletstatsreceiver/go.mod index 90927fe71f3d..cd632034e1fb 100644 --- a/receiver/kubeletstatsreceiver/go.mod +++ b/receiver/kubeletstatsreceiver/go.mod @@ -6,9 +6,9 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.117.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.117.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest v0.117.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.117.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.117.0 @@ -155,7 +155,7 @@ retract ( v0.65.0 ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest => ../../internal/k8stest +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest => ../../pkg/k8stest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/versions.yaml b/versions.yaml index c44692c506a9..62ec5a6c0b63 100644 --- a/versions.yaml +++ b/versions.yaml @@ -130,7 +130,6 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter - github.com/open-telemetry/opentelemetry-collector-contrib/internal/grpcutil - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig - - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest - github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka - github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet - github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders @@ -144,6 +143,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden + - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/k8stest - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/kafka/topic - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest