Skip to content

Commit 4b75868

Browse files
[receiver/k8slog] unexport DockerConfig and CRIConfig (#40274)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 4182a5c commit 4b75868

File tree

4 files changed

+42
-15
lines changed

4 files changed

+42
-15
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: k8slogreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Unexport DockerConfig and CRIConfig
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [40274]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [api]

receiver/k8slogreceiver/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestLoadConfig(t *testing.T) {
4242
HostRoot: "/host_root",
4343
RuntimeAPIs: []RuntimeAPIConfig{
4444
{
45-
&DockerConfig{
45+
&dockerConfig{
4646
baseRuntimeAPIConfig: baseRuntimeAPIConfig{
4747
Type: "docker",
4848
},
@@ -51,7 +51,7 @@ func TestLoadConfig(t *testing.T) {
5151
},
5252
},
5353
{
54-
&CRIConfig{
54+
&criConfig{
5555
baseRuntimeAPIConfig: baseRuntimeAPIConfig{
5656
Type: "cri",
5757
},

receiver/k8slogreceiver/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func createDefaultConfig() component.Config {
3434
K8sAPI: k8sconfig.APIConfig{AuthType: k8sconfig.AuthTypeServiceAccount},
3535
RuntimeAPIs: []RuntimeAPIConfig{
3636
{
37-
&CRIConfig{
37+
&criConfig{
3838
baseRuntimeAPIConfig: baseRuntimeAPIConfig{
3939
Type: "cri",
4040
},

receiver/k8slogreceiver/runtime_api_config.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import (
1212

1313
var runtimeAPIBuilderFactories = map[string]func() runtimeAPIBuilder{
1414
"docker": func() runtimeAPIBuilder {
15-
return &DockerConfig{}
15+
return &dockerConfig{}
1616
},
1717
"cri": func() runtimeAPIBuilder {
18-
return &CRIConfig{}
18+
return &criConfig{}
1919
},
2020
}
2121

@@ -59,8 +59,8 @@ type baseRuntimeAPIConfig struct {
5959
Type string `mapstructure:"type"`
6060
}
6161

62-
// CRIConfig allows specifying how to connect to the CRI server.
63-
type CRIConfig struct {
62+
// criConfig allows specifying how to connect to the CRI server.
63+
type criConfig struct {
6464
baseRuntimeAPIConfig `mapstructure:",squash"`
6565

6666
// Addr represents the address of the CRI endpoint.
@@ -74,23 +74,23 @@ type CRIConfig struct {
7474
ContainerdState string `mapstructure:"containerd_state"`
7575
}
7676

77-
func (c *CRIConfig) Validate() error {
77+
func (c *criConfig) Validate() error {
7878
return nil
7979
}
8080

81-
func (c *CRIConfig) Type() string {
81+
func (c *criConfig) Type() string {
8282
return "cri"
8383
}
8484

85-
func (c *CRIConfig) NewClient(logger *zap.Logger, hostRoot string) (any, error) {
85+
func (c *criConfig) NewClient(logger *zap.Logger, hostRoot string) (any, error) {
8686
_ = logger
8787
_ = hostRoot
8888
// TODO implement me
8989
panic("implement me")
9090
}
9191

92-
// DockerConfig allows specifying how to connect to the Docker daemon.
93-
type DockerConfig struct {
92+
// dockerConfig allows specifying how to connect to the Docker daemon.
93+
type dockerConfig struct {
9494
baseRuntimeAPIConfig `mapstructure:",squash"`
9595

9696
// Addr represents the address of the Docker daemon.
@@ -105,15 +105,15 @@ type DockerConfig struct {
105105
ContainerdAddr string `mapstructure:"containerd_addr"`
106106
}
107107

108-
func (c *DockerConfig) Validate() error {
108+
func (c *dockerConfig) Validate() error {
109109
return nil
110110
}
111111

112-
func (c *DockerConfig) Type() string {
112+
func (c *dockerConfig) Type() string {
113113
return "docker"
114114
}
115115

116-
func (c *DockerConfig) NewClient(logger *zap.Logger, hostRoot string) (any, error) {
116+
func (c *dockerConfig) NewClient(logger *zap.Logger, hostRoot string) (any, error) {
117117
_ = logger
118118
_ = hostRoot
119119
// TODO implement me

0 commit comments

Comments
 (0)