Skip to content

Commit

Permalink
[extension/k8sobserver] unexport NewNode,NewPod (#26645)
Browse files Browse the repository at this point in the history
**Link to tracking Issue:** <Issue number if applicable>


#26304

---------

Signed-off-by: Jared Tan <jian.tan@daocloud.io>
  • Loading branch information
JaredTan95 authored Sep 14, 2023
1 parent aadfba7 commit ec3f9bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
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)
}

0 comments on commit ec3f9bf

Please sign in to comment.