Skip to content

Commit

Permalink
Fix workflow issues
Browse files Browse the repository at this point in the history
  • Loading branch information
KlwntSingh committed Dec 17, 2023
1 parent d575b52 commit d33f2d1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ require (
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/kubelet v0.28.3 // indirect
k8s.io/kubelet v0.28.4 // indirect
k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect
sigs.k8s.io/controller-runtime v0.16.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//go:build !linux
// +build !linux

package host
package host // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/host"

// These variables are invalid for Windows
const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//go:build !windows
// +build !windows

package host
package host // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/host"

const (
rootfs = "/rootfs" // the root directory "/" is mounted as "/rootfs" in container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//go:build windows
// +build windows

package k8swindows
package k8swindows // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/k8swindows"

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//go:build !windows
// +build !windows

package k8swindows
package k8swindows // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/k8swindows"

import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/host"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//go:build windows
// +build windows

package k8swindows
package k8swindows // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver/internal/k8swindows"

import (
"fmt"
Expand Down
10 changes: 5 additions & 5 deletions receiver/awscontainerinsightreceiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ func TestCollectData(t *testing.T) {
_ = r.Start(context.Background(), nil)
ctx := context.Background()
r.k8sapiserver = &mockK8sAPIServer{}
r.cadvisor = &mockCadvisor{}
r.containerMetricsProvider = &mockCadvisor{}
err = r.collectData(ctx)
require.Nil(t, err)

// test the case when cadvisor and k8sapiserver failed to initialize
r.cadvisor = nil
r.containerMetricsProvider = nil
r.k8sapiserver = nil
err = r.collectData(ctx)
require.NotNil(t, err)
Expand All @@ -114,7 +114,7 @@ func TestCollectDataWithErrConsumer(t *testing.T) {

r := metricsReceiver.(*awsContainerInsightReceiver)
_ = r.Start(context.Background(), nil)
r.cadvisor = &mockCadvisor{}
r.containerMetricsProvider = &mockCadvisor{}
r.k8sapiserver = &mockK8sAPIServer{}
ctx := context.Background()

Expand All @@ -138,12 +138,12 @@ func TestCollectDataWithECS(t *testing.T) {
_ = r.Start(context.Background(), nil)
ctx := context.Background()

r.cadvisor = &mockCadvisor{}
r.containerMetricsProvider = &mockCadvisor{}
err = r.collectData(ctx)
require.Nil(t, err)

// test the case when cadvisor and k8sapiserver failed to initialize
r.cadvisor = nil
r.containerMetricsProvider = nil
err = r.collectData(ctx)
require.NotNil(t, err)
}

0 comments on commit d33f2d1

Please sign in to comment.