Skip to content

Commit

Permalink
Change error logs to info for building container (open-telemetry#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristina Pathak authored Oct 7, 2022
1 parent f31ce5b commit 9424cae
Showing 1 changed file with 2 additions and 5 deletions.
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

0 comments on commit 9424cae

Please sign in to comment.