Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[extension/k8sobserver] unexport NewNode,NewPod #26645

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/checkapi/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ exporter/sentryexporter
exporter/sumologicexporter
extension/observer/ecsobserver
extension/observer
extension/observer/k8sobserver
processor/groupbyattrsprocessor
processor/groupbytraceprocessor
processor/probabilisticsamplerprocessor
Expand Down
14 changes: 7 additions & 7 deletions extension/observer/k8sobserver/k8s_fixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"k8s.io/apimachinery/pkg/types"
)

// NewPod is a helper function for creating Pods for testing.
func NewPod(name, host string) *v1.Pod {
// newPod is a helper function for creating Pods for testing.
func newPod(name, host string) *v1.Pod {
pod := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Expand Down Expand Up @@ -38,7 +38,7 @@ func NewPod(name, host string) *v1.Pod {
return pod
}

var pod1V1 = NewPod("pod1", "localhost")
var pod1V1 = newPod("pod1", "localhost")
var pod1V2 = func() *v1.Pod {
pod := pod1V1.DeepCopy()
pod.Labels["pod-version"] = "2"
Expand Down Expand Up @@ -85,7 +85,7 @@ var container2StatusRunning = v1.ContainerStatus{
}

var podWithNamedPorts = func() *v1.Pod {
pod := NewPod("pod-2", "localhost")
pod := newPod("pod-2", "localhost")
pod.Labels = map[string]string{
"env": "prod",
}
Expand All @@ -104,8 +104,8 @@ func pointerBool(val bool) *bool {
return &val
}

// NewNode is a helper function for creating Nodes for testing.
func NewNode(name, hostname string) *v1.Node {
// newNode is a helper function for creating Nodes for testing.
func newNode(name, hostname string) *v1.Node {
return &v1.Node{
ObjectMeta: metav1.ObjectMeta{
Namespace: "namespace",
Expand Down Expand Up @@ -147,7 +147,7 @@ func NewNode(name, hostname string) *v1.Node {
}
}

var node1V1 = NewNode("node1", "localhost")
var node1V1 = newNode("node1", "localhost")
var node1V2 = func() *v1.Node {
node := node1V1.DeepCopy()
node.Labels["node-version"] = "2"
Expand Down
2 changes: 1 addition & 1 deletion extension/observer/k8sobserver/node_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ func TestNodeObjectToK8sNodeEndpoint(t *testing.T) {
},
}

endpoint := convertNodeToEndpoint("namespace", NewNode("name", "hostname"))
endpoint := convertNodeToEndpoint("namespace", newNode("name", "hostname"))
require.Equal(t, expectedNode, endpoint)
}