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

Change error logs to info for building container #1146

Merged
merged 1 commit into from
Oct 7, 2022
Merged
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
7 changes: 2 additions & 5 deletions pkg/collector/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package collector

import (
"errors"
"fmt"
"net"
"sort"
Expand All @@ -36,8 +35,6 @@ import (
// https://pkg.go.dev/k8s.io/apimachinery/pkg/util/validation#IsValidPortName
const maxPortLen = 15

var errInvalidPort = errors.New("invalid port name/num")

// Container builds a container for the given collector.
func Container(cfg config.Config, logger logr.Logger, otelcol v1alpha1.OpenTelemetryCollector) corev1.Container {
image := otelcol.Spec.Image
Expand Down Expand Up @@ -154,7 +151,7 @@ func getConfigContainerPorts(logger logr.Logger, cfg string) map[string]corev1.C
nameErrs := validation.IsValidPortName(truncName)
numErrs := validation.IsValidPortNum(int(p.Port))
if len(nameErrs) > 0 || len(numErrs) > 0 {
logger.Error(errInvalidPort, "dropping container port", "port.name", truncName, "port.num", p.Port,
logger.Info("dropping invalid container port", "port.name", truncName, "port.num", p.Port,
"port.name.errs", nameErrs, "num.errs", numErrs)
continue
}
Expand All @@ -168,7 +165,7 @@ func getConfigContainerPorts(logger logr.Logger, cfg string) map[string]corev1.C

metricsPort, err := getMetricsPort(c)
if err != nil {
logger.Error(err, "couldn't determine metrics port from configuration, using 8888 default value")
logger.Info("couldn't determine metrics port from configuration, using 8888 default value", "error", err)
metricsPort = 8888
}
ports["metrics"] = corev1.ContainerPort{
Expand Down