diff --git a/internal/config/main.go b/internal/config/main.go index 04d2913572..64aeaa551d 100644 --- a/internal/config/main.go +++ b/internal/config/main.go @@ -141,6 +141,7 @@ func (c *Config) AutoDetect() error { } c.autoscalingVersion = hpaVersion c.logger.V(1).Info("autoscaling version detected", "autoscaling-version", c.autoscalingVersion.String()) + return nil } diff --git a/pkg/collector/adapters/config_to_ports_test.go b/pkg/collector/adapters/config_to_ports_test.go index 84c10e3d83..47d8e793fe 100644 --- a/pkg/collector/adapters/config_to_ports_test.go +++ b/pkg/collector/adapters/config_to_ports_test.go @@ -205,7 +205,8 @@ func TestParserFailed(t *testing.T) { } type mockParser struct { - portsFunc func() ([]corev1.ServicePort, error) + portsFunc func() ([]corev1.ServicePort, error) + containerPortsFunc func() ([]corev1.ContainerPort, error) } func (m *mockParser) Ports() ([]corev1.ServicePort, error) { @@ -216,6 +217,14 @@ func (m *mockParser) Ports() ([]corev1.ServicePort, error) { return nil, nil } +func (m *mockParser) ContainerPorts() ([]corev1.ContainerPort, error) { + if m.containerPortsFunc != nil { + return m.containerPortsFunc() + } + + return nil, nil +} + func (m *mockParser) ParserName() string { return "__mock-adapters" } diff --git a/pkg/collector/parser/receiver_test.go b/pkg/collector/parser/receiver_test.go index 2566f7a7be..3c74535c8c 100644 --- a/pkg/collector/parser/receiver_test.go +++ b/pkg/collector/parser/receiver_test.go @@ -144,6 +144,10 @@ func (m *mockParser) Ports() ([]corev1.ServicePort, error) { return nil, nil } +func (m *mockParser) ContainerPorts() ([]corev1.ContainerPort, error) { + return nil, nil +} + func (m *mockParser) ParserName() string { return "__mock" }