diff --git a/internal/k8stest/k8s_collector.go b/internal/k8stest/k8s_collector.go index d607fd194e1a..87252ee687e6 100644 --- a/internal/k8stest/k8s_collector.go +++ b/internal/k8stest/k8s_collector.go @@ -27,6 +27,9 @@ func CreateCollectorObjects(t *testing.T, client *K8sClient, testID string, mani 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") + } var podNamespace string var podLabels map[string]any createdObjs := make([]*unstructured.Unstructured, 0, len(manifestFiles)) diff --git a/internal/k8stest/k8s_data_helpers.go b/internal/k8stest/k8s_data_helpers.go index 50be3a2336f5..3fbde5005eae 100644 --- a/internal/k8stest/k8s_data_helpers.go +++ b/internal/k8stest/k8s_data_helpers.go @@ -28,7 +28,9 @@ func HostEndpoint(t *testing.T) string { network, err := client.NetworkInspect(ctx, "kind", types.NetworkInspectOptions{}) require.NoError(t, err) for _, ipam := range network.IPAM.Config { - return ipam.Gateway + if ipam.Gateway != "" { + return ipam.Gateway + } } require.Fail(t, "failed to find host endpoint") return "" diff --git a/processor/k8sattributesprocessor/e2e_test.go b/processor/k8sattributesprocessor/e2e_test.go index 942e9c98f94e..7520f06169b6 100644 --- a/processor/k8sattributesprocessor/e2e_test.go +++ b/processor/k8sattributesprocessor/e2e_test.go @@ -59,7 +59,6 @@ func newExpectedValue(mode int, value string) *expectedValue { // make docker-otelcontribcol // KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image otelcontribcol:latest func TestE2E_ClusterRBAC(t *testing.T) { - t.Skip("skipping flaky test, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33520") testDir := filepath.Join("testdata", "e2e", "clusterrbac") @@ -422,7 +421,6 @@ func TestE2E_ClusterRBAC(t *testing.T) { // Test with `filter::namespace` set and only role binding to collector's SA. We can't get node and namespace labels/annotations. func TestE2E_NamespacedRBAC(t *testing.T) { - t.Skip("skipping flaky test, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33520") testDir := filepath.Join("testdata", "e2e", "namespacedrbac") @@ -563,7 +561,6 @@ func TestE2E_NamespacedRBAC(t *testing.T) { // Test with `filter::namespace` set, role binding for namespace-scoped objects (pod, replicaset) and clusterrole // binding for node and namespace objects. func TestE2E_MixRBAC(t *testing.T) { - t.Skip("skipping flaky test, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33520") testDir := filepath.Join("testdata", "e2e", "mixrbac") diff --git a/receiver/k8sclusterreceiver/e2e_test.go b/receiver/k8sclusterreceiver/e2e_test.go index 543afb4ce1ec..8e3418c61b11 100644 --- a/receiver/k8sclusterreceiver/e2e_test.go +++ b/receiver/k8sclusterreceiver/e2e_test.go @@ -36,7 +36,6 @@ const testKubeConfig = "/tmp/kube-config-otelcol-e2e-testing" // make docker-otelcontribcol // KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image otelcontribcol:latest func TestE2E(t *testing.T) { - t.Skip("skipping flaky test, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33520") var expected pmetric.Metrics expectedFile := filepath.Join("testdata", "e2e", "expected.yaml") diff --git a/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml b/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml index e641e7d50f2a..c52d7a66b703 100644 --- a/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml +++ b/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml @@ -812,7 +812,7 @@ resourceMetrics: stringValue: 1a5b9c371c8a7c5d8b0e56a82395aeee88523b1e2d96f17b4a6ae22bf11936bb - key: container.image.name value: - stringValue: registry.k8s.io/kube-apiserver + stringValue: registry.k8s.io/kube-apiserver-amd64 - key: container.image.tag value: stringValue: v1.25.3 @@ -865,7 +865,7 @@ resourceMetrics: stringValue: 2e506922310bbf1ffb8dbbf56c04e540306f272b794d89ffbe776fe5e2fc148e - key: container.image.name value: - stringValue: registry.k8s.io/kube-scheduler + stringValue: registry.k8s.io/kube-scheduler-amd64 - key: container.image.tag value: stringValue: v1.25.3 @@ -918,7 +918,7 @@ resourceMetrics: stringValue: 3baa03c525095d74e7ee24a5c4c42a4680b131f9b8a68f5e2e853ae569d97e4c - key: container.image.name value: - stringValue: registry.k8s.io/kube-controller-manager + stringValue: registry.k8s.io/kube-controller-manager-amd64 - key: container.image.tag value: stringValue: v1.25.3 @@ -971,7 +971,7 @@ resourceMetrics: stringValue: 5cfead143bc88798f93fae8e05586b1191771477030fe89ed7bca288bb82c0aa - key: container.image.name value: - stringValue: registry.k8s.io/kube-proxy + stringValue: registry.k8s.io/kube-proxy-amd64 - key: container.image.tag value: stringValue: v1.25.3 diff --git a/receiver/k8sobjectsreceiver/e2e_test.go b/receiver/k8sobjectsreceiver/e2e_test.go index 78031c421677..4af2cb1e9c21 100644 --- a/receiver/k8sobjectsreceiver/e2e_test.go +++ b/receiver/k8sobjectsreceiver/e2e_test.go @@ -40,7 +40,6 @@ const ( ) func TestE2E(t *testing.T) { - t.Skip("skipping flaky test, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33520") k8sClient, err := k8stest.NewK8sClient(testKubeConfig) require.NoError(t, err) diff --git a/receiver/kubeletstatsreceiver/e2e_test.go b/receiver/kubeletstatsreceiver/e2e_test.go index cb8b832e7114..ba5ace29985b 100644 --- a/receiver/kubeletstatsreceiver/e2e_test.go +++ b/receiver/kubeletstatsreceiver/e2e_test.go @@ -28,7 +28,6 @@ import ( const testKubeConfig = "/tmp/kube-config-otelcol-e2e-testing" func TestE2E(t *testing.T) { - t.Skip("skipping flaky test, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33520") var expected pmetric.Metrics expectedFile := filepath.Join("testdata", "e2e", "expected.yaml")