Skip to content

Commit

Permalink
[chore]: enable gofumpt linter for extension (#36370)
Browse files Browse the repository at this point in the history
#### Description

[gofumpt](https://golangci-lint.run/usage/linters/#gofumpt) enforces a
stricter format than gofmt

Part of
#36363

Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 authored Nov 20, 2024
1 parent f1b6311 commit 8c73b4e
Show file tree
Hide file tree
Showing 49 changed files with 171 additions and 144 deletions.
1 change: 0 additions & 1 deletion extension/awsproxy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

// Config defines the configuration for an AWS X-Ray proxy.
type Config struct {

// ProxyServer defines configurations related to the local TCP proxy server.
ProxyConfig proxy.Config `mapstructure:",squash"`
}
1 change: 0 additions & 1 deletion extension/awsproxy/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var _ extension.Extension = (*xrayProxy)(nil)

func (x *xrayProxy) Start(_ context.Context, host component.Host) error {
srv, err := proxy.NewServer(&x.config.ProxyConfig, x.settings.Logger)

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion extension/basicauthextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type ClientAuthSettings struct {
Password configopaque.String `mapstructure:"password"`
}
type Config struct {

// Htpasswd settings.
Htpasswd *HtpasswdSettings `mapstructure:"htpasswd,omitempty"`

Expand Down
52 changes: 25 additions & 27 deletions extension/basicauthextension/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,31 @@ import (
"go.opentelemetry.io/collector/component/componenttest"
)

var (
credentials = [][]string{
{"htpasswd-md5", "$apr1$FVVioVP7$ZdIWPG1p4E/ErujO7kA2n0"},
{"openssl-apr1", "$apr1$peiE49Vv$lo.z77Z.6.a.Lm7GMjzQh0"},
{"openssl-md5", "$1$mvmz31IB$U9KpHBLegga2doA0e3s3N0"},
{"htpasswd-sha", "{SHA}vFznddje0Ht4+pmO0FaxwrUKN/M="},
{"htpasswd-bcrypt", "$2y$10$Q6GeMFPd0dAxhQULPDdAn.DFy6NDmLaU0A7e2XoJz7PFYAEADFKbC"},
{"", "$2a$06$DCq7YPn5Rq63x1Lad4cll.TV4S6ytwfsfvkgY8jIucDrjc8deX1s."},
{"", "$2a$08$HqWuK6/Ng6sg9gQzbLrgb.Tl.ZHfXLhvt/SgVyWhQqgqcZ7ZuUtye"},
{"", "$2a$10$k1wbIrmNyFAPwPVPSVa/zecw2BCEnBwVS2GbrmgzxFUOqW9dk4TCW"},
{"", "$2a$12$k42ZFHFWqBp3vWli.nIn8uYyIkbvYRvodzbfbK18SSsY.CsIQPlxO"},
{"a", "$2a$06$m0CrhHm10qJ3lXRY.5zDGO3rS2KdeeWLuGmsfGlMfOxih58VYVfxe"},
{"a", "$2a$08$cfcvVd2aQ8CMvoMpP2EBfeodLEkkFJ9umNEfPD18.hUF62qqlC/V."},
{"a", "$2a$10$k87L/MF28Q673VKh8/cPi.SUl7MU/rWuSiIDDFayrKk/1tBsSQu4u"},
{"a", "$2a$12$8NJH3LsPrANStV6XtBakCez0cKHXVxmvxIlcz785vxAIZrihHZpeS"},
{"abc", "$2a$06$If6bvum7DFjUnE9p2uDeDu0YHzrHM6tf.iqN8.yx.jNN1ILEf7h0i"},
{"abcdefghijklmnopqrstuvwxyz", "$2a$06$.rCVZVOThsIa97pEDOxvGuRRgzG64bvtJ0938xuqzv18d3ZpQhstC"},
{"abcdefghijklmnopqrstuvwxyz", "$2a$08$aTsUwsyowQuzRrDqFflhgekJ8d9/7Z3GV3UcgvzQW3J5zMyrTvlz."},
{"abcdefghijklmnopqrstuvwxyz", "$2a$10$fVH8e28OQRj9tqiDXs1e1uxpsjN0c7II7YPKXua2NAKYvM6iQk7dq"},
{"abcdefghijklmnopqrstuvwxyz", "$2a$12$D4G5f18o7aMMfwasBL7GpuQWuP3pkrZrOAnqP.bmezbMng.QwJ/pG"},
{"~!@#$%^&*() ~!@#$%^&*()PNBFRD", "$2a$06$fPIsBO8qRqkjj273rfaOI.HtSV9jLDpTbZn782DC6/t7qT67P6FfO"},
{"~!@#$%^&*() ~!@#$%^&*()PNBFRD", "$2a$08$Eq2r4G/76Wv39MzSX262huzPz612MZiYHVUJe/OcOql2jo4.9UxTW"},
{"~!@#$%^&*() ~!@#$%^&*()PNBFRD", "$2a$10$LgfYWkbzEvQ4JakH7rOvHe0y8pHKF9OaFgwUZ2q7W2FFZmZzJYlfS"},
{"~!@#$%^&*() ~!@#$%^&*()PNBFRD", "$2a$12$WApznUOJfkEGSmYRfnkrPOr466oFDCaj4b6HY3EXGvfxm43seyhgC"},
{"ππππππππ", "$2a$10$.TtQJ4Jr6isd4Hp.mVfZeuh6Gws4rOQ/vdBczhDx.19NFK0Y84Dle"},
}
)
var credentials = [][]string{
{"htpasswd-md5", "$apr1$FVVioVP7$ZdIWPG1p4E/ErujO7kA2n0"},
{"openssl-apr1", "$apr1$peiE49Vv$lo.z77Z.6.a.Lm7GMjzQh0"},
{"openssl-md5", "$1$mvmz31IB$U9KpHBLegga2doA0e3s3N0"},
{"htpasswd-sha", "{SHA}vFznddje0Ht4+pmO0FaxwrUKN/M="},
{"htpasswd-bcrypt", "$2y$10$Q6GeMFPd0dAxhQULPDdAn.DFy6NDmLaU0A7e2XoJz7PFYAEADFKbC"},
{"", "$2a$06$DCq7YPn5Rq63x1Lad4cll.TV4S6ytwfsfvkgY8jIucDrjc8deX1s."},
{"", "$2a$08$HqWuK6/Ng6sg9gQzbLrgb.Tl.ZHfXLhvt/SgVyWhQqgqcZ7ZuUtye"},
{"", "$2a$10$k1wbIrmNyFAPwPVPSVa/zecw2BCEnBwVS2GbrmgzxFUOqW9dk4TCW"},
{"", "$2a$12$k42ZFHFWqBp3vWli.nIn8uYyIkbvYRvodzbfbK18SSsY.CsIQPlxO"},
{"a", "$2a$06$m0CrhHm10qJ3lXRY.5zDGO3rS2KdeeWLuGmsfGlMfOxih58VYVfxe"},
{"a", "$2a$08$cfcvVd2aQ8CMvoMpP2EBfeodLEkkFJ9umNEfPD18.hUF62qqlC/V."},
{"a", "$2a$10$k87L/MF28Q673VKh8/cPi.SUl7MU/rWuSiIDDFayrKk/1tBsSQu4u"},
{"a", "$2a$12$8NJH3LsPrANStV6XtBakCez0cKHXVxmvxIlcz785vxAIZrihHZpeS"},
{"abc", "$2a$06$If6bvum7DFjUnE9p2uDeDu0YHzrHM6tf.iqN8.yx.jNN1ILEf7h0i"},
{"abcdefghijklmnopqrstuvwxyz", "$2a$06$.rCVZVOThsIa97pEDOxvGuRRgzG64bvtJ0938xuqzv18d3ZpQhstC"},
{"abcdefghijklmnopqrstuvwxyz", "$2a$08$aTsUwsyowQuzRrDqFflhgekJ8d9/7Z3GV3UcgvzQW3J5zMyrTvlz."},
{"abcdefghijklmnopqrstuvwxyz", "$2a$10$fVH8e28OQRj9tqiDXs1e1uxpsjN0c7II7YPKXua2NAKYvM6iQk7dq"},
{"abcdefghijklmnopqrstuvwxyz", "$2a$12$D4G5f18o7aMMfwasBL7GpuQWuP3pkrZrOAnqP.bmezbMng.QwJ/pG"},
{"~!@#$%^&*() ~!@#$%^&*()PNBFRD", "$2a$06$fPIsBO8qRqkjj273rfaOI.HtSV9jLDpTbZn782DC6/t7qT67P6FfO"},
{"~!@#$%^&*() ~!@#$%^&*()PNBFRD", "$2a$08$Eq2r4G/76Wv39MzSX262huzPz612MZiYHVUJe/OcOql2jo4.9UxTW"},
{"~!@#$%^&*() ~!@#$%^&*()PNBFRD", "$2a$10$LgfYWkbzEvQ4JakH7rOvHe0y8pHKF9OaFgwUZ2q7W2FFZmZzJYlfS"},
{"~!@#$%^&*() ~!@#$%^&*()PNBFRD", "$2a$12$WApznUOJfkEGSmYRfnkrPOr466oFDCaj4b6HY3EXGvfxm43seyhgC"},
{"ππππππππ", "$2a$10$.TtQJ4Jr6isd4Hp.mVfZeuh6Gws4rOQ/vdBczhDx.19NFK0Y84Dle"},
}

func TestBasicAuth_Valid(t *testing.T) {
t.Parallel()
Expand Down
8 changes: 4 additions & 4 deletions extension/bearertokenauthextension/bearertokenauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestBearerStartWatchStop(t *testing.T) {
assert.True(t, credential.RequireTransportSecurity())

// change file content once
assert.NoError(t, os.WriteFile(bauth.filename, []byte(fmt.Sprintf("%stest", token)), 0600))
assert.NoError(t, os.WriteFile(bauth.filename, []byte(fmt.Sprintf("%stest", token)), 0o600))
time.Sleep(5 * time.Second)
credential, _ = bauth.PerRPCCredentials()
md, err = credential.GetRequestMetadata(context.Background())
Expand All @@ -136,7 +136,7 @@ func TestBearerStartWatchStop(t *testing.T) {
assert.NoError(t, err)

// change file content back
assert.NoError(t, os.WriteFile(bauth.filename, token, 0600))
assert.NoError(t, os.WriteFile(bauth.filename, token, 0o600))
time.Sleep(5 * time.Second)
credential, _ = bauth.PerRPCCredentials()
md, err = credential.GetRequestMetadata(context.Background())
Expand Down Expand Up @@ -177,7 +177,7 @@ func TestBearerTokenFileContentUpdate(t *testing.T) {
assert.Equal(t, authHeaderValue, fmt.Sprintf("%s %s", scheme, string(token)))

// change file content once
assert.NoError(t, os.WriteFile(bauth.filename, []byte(fmt.Sprintf("%stest", token)), 0600))
assert.NoError(t, os.WriteFile(bauth.filename, []byte(fmt.Sprintf("%stest", token)), 0o600))
time.Sleep(5 * time.Second)

tokenNew, err := os.ReadFile(bauth.filename)
Expand All @@ -191,7 +191,7 @@ func TestBearerTokenFileContentUpdate(t *testing.T) {
assert.Equal(t, authHeaderValue, fmt.Sprintf("%s %s", scheme, string(tokenNew)))

// change file content back
assert.NoError(t, os.WriteFile(bauth.filename, token, 0600))
assert.NoError(t, os.WriteFile(bauth.filename, token, 0o600))
time.Sleep(5 * time.Second)

// check if request is updated with the old token
Expand Down
7 changes: 4 additions & 3 deletions extension/bearertokenauthextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

// Config specifies how the Per-RPC bearer token based authentication data should be obtained.
type Config struct {

// Scheme specifies the auth-scheme for the token. Defaults to "Bearer"
Scheme string `mapstructure:"scheme,omitempty"`

Expand All @@ -23,8 +22,10 @@ type Config struct {
Filename string `mapstructure:"filename,omitempty"`
}

var _ component.Config = (*Config)(nil)
var errNoTokenProvided = errors.New("no bearer token provided")
var (
_ component.Config = (*Config)(nil)
errNoTokenProvided = errors.New("no bearer token provided")
)

// Validate checks if the extension configuration is valid
func (cfg *Config) Validate() error {
Expand Down
4 changes: 1 addition & 3 deletions extension/encoding/avrologencodingextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding"
)

var (
_ encoding.LogsUnmarshalerExtension = (*avroLogExtension)(nil)
)
var _ encoding.LogsUnmarshalerExtension = (*avroLogExtension)(nil)

type avroLogExtension struct {
deserializer avroDeserializer
Expand Down
6 changes: 4 additions & 2 deletions extension/encoding/jaegerencodingextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding"
)

var _ encoding.TracesUnmarshalerExtension = &jaegerExtension{}
var _ ptrace.Unmarshaler = &jaegerExtension{}
var (
_ encoding.TracesUnmarshalerExtension = &jaegerExtension{}
_ ptrace.Unmarshaler = &jaegerExtension{}
)

type jaegerExtension struct {
config *Config
Expand Down
6 changes: 2 additions & 4 deletions extension/encoding/jaegerencodingextension/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger"
)

type jaegerProtobufTrace struct {
}
type jaegerProtobufTrace struct{}

func (j jaegerProtobufTrace) UnmarshalTraces(buf []byte) (ptrace.Traces, error) {
span := &jaegerproto.Span{}
Expand All @@ -25,8 +24,7 @@ func (j jaegerProtobufTrace) UnmarshalTraces(buf []byte) (ptrace.Traces, error)
return jaegerSpanToTraces(span)
}

type jaegerJSONTrace struct {
}
type jaegerJSONTrace struct{}

func (j jaegerJSONTrace) UnmarshalTraces(buf []byte) (ptrace.Traces, error) {
span := &jaegerproto.Span{}
Expand Down
8 changes: 4 additions & 4 deletions extension/encoding/otlpencodingextension/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func createAndExtension0(c *Config, t *testing.T) *otlpExtension {
}

func generateTraces() ptrace.Traces {
var num = 10
num := 10
now := time.Now()
md := ptrace.NewTraces()
ilm := md.ResourceSpans().AppendEmpty().ScopeSpans().AppendEmpty()
Expand All @@ -162,7 +162,7 @@ func generateTraces() ptrace.Traces {
}

func generateLogs() plog.Logs {
var num = 10
num := 10
md := plog.NewLogs()
ilm := md.ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty()
ilm.LogRecords().EnsureCapacity(num)
Expand All @@ -174,7 +174,7 @@ func generateLogs() plog.Logs {
}

func generateMetrics() pmetric.Metrics {
var num = 10
num := 10
now := time.Now()
startTime := pcommon.NewTimestampFromTime(now.Add(-10 * time.Second))
endTime := pcommon.NewTimestampFromTime(now)
Expand All @@ -194,7 +194,7 @@ func generateMetrics() pmetric.Metrics {
}

func generateProfiles() pprofile.Profiles {
var num = 10
num := 10
now := time.Now()
pd := pprofile.NewProfiles()
ilm := pd.ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty()
Expand Down
3 changes: 2 additions & 1 deletion extension/headerssetterextension/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func TestLoadConfig(t *testing.T) {
Action: INSERT,
FromContext: stringp("tenant_id"),
Value: nil,
}, {
},
{
Key: stringp("X-Scope-OrgID"),
Action: INSERT,
FromContext: stringp("tenant_id"),
Expand Down
2 changes: 1 addition & 1 deletion extension/headerssetterextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func newHeadersSetterExtension(cfg *Config, logger *zap.Logger) (auth.Client, er
Value: *header.Value,
}
} else if header.FromContext != nil {
var defaultValue = ""
defaultValue := ""
if header.DefaultValue != nil {
defaultValue = *header.DefaultValue
}
Expand Down
8 changes: 5 additions & 3 deletions extension/healthcheckv2extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ type healthCheckExtension struct {
host component.Host
}

var _ component.Component = (*healthCheckExtension)(nil)
var _ extensioncapabilities.ConfigWatcher = (*healthCheckExtension)(nil)
var _ extensioncapabilities.PipelineWatcher = (*healthCheckExtension)(nil)
var (
_ component.Component = (*healthCheckExtension)(nil)
_ extensioncapabilities.ConfigWatcher = (*healthCheckExtension)(nil)
_ extensioncapabilities.PipelineWatcher = (*healthCheckExtension)(nil)
)

func newExtension(
ctx context.Context,
Expand Down
6 changes: 4 additions & 2 deletions extension/healthcheckv2extension/internal/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ type Server struct {
doneCh chan struct{}
}

var _ component.Component = (*Server)(nil)
var _ extensioncapabilities.ConfigWatcher = (*Server)(nil)
var (
_ component.Component = (*Server)(nil)
_ extensioncapabilities.ConfigWatcher = (*Server)(nil)
)

func NewServer(
config *Config,
Expand Down
1 change: 0 additions & 1 deletion extension/httpforwarderextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

// Config defines configuration for http forwarder extension.
type Config struct {

// Ingress holds config settings for HTTP server listening for requests.
Ingress confighttp.ServerConfig `mapstructure:"ingress"`

Expand Down
2 changes: 1 addition & 1 deletion extension/httpforwarderextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func newHTTPForwarder(config *Config, settings component.TelemetrySettings) (ext
return nil, errors.New("'egress.endpoint' config option cannot be empty")
}

var url, err = url.Parse(config.Egress.Endpoint)
url, err := url.Parse(config.Egress.Endpoint)
if err != nil {
return nil, fmt.Errorf("enter a valid URL for 'egress.endpoint': %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion extension/httpforwarderextension/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func readBody(body io.ReadCloser) []byte {
}

func getParsedURL(t *testing.T, rawURL string) *url.URL {
var url, err = url.Parse(rawURL)
url, err := url.Parse(rawURL)
require.NoError(t, err)
return url
}
2 changes: 2 additions & 0 deletions extension/jaegerremotesampling/internal/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ func (g *grpcServerMock) Serve(_ net.Listener) error {
g.quit = make(chan bool)
return nil
}

func (g *grpcServerMock) Stop() {
g.quit <- true
}

func (g *grpcServerMock) GracefulStop() {
select {
case <-g.quit:
Expand Down
4 changes: 1 addition & 3 deletions extension/jaegerremotesampling/internal/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import (
"go.opentelemetry.io/collector/config/confighttp"
)

var (
errMissingStrategyStore = errors.New("the strategy store has not been provided")
)
var errMissingStrategyStore = errors.New("the strategy store has not been provided")

var _ component.Component = (*SamplingHTTPServer)(nil)

Expand Down
1 change: 0 additions & 1 deletion extension/oauth2clientauthextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var (

// Config stores the configuration for OAuth2 Client Credentials (2-legged OAuth2 flow) setup.
type Config struct {

// ClientID is the application's ID.
// See https://datatracker.ietf.org/doc/html/rfc6749#section-2.2
ClientID string `mapstructure:"client_id"`
Expand Down
1 change: 0 additions & 1 deletion extension/observer/ecsobserver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const (
)

type Config struct {

// ClusterName is the target ECS cluster name for service discovery.
ClusterName string `mapstructure:"cluster_name" yaml:"cluster_name"`
// ClusterRegion is the target ECS cluster's AWS region.
Expand Down
3 changes: 2 additions & 1 deletion extension/observer/ecsobserver/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ func (f *taskFetcher) attachContainerInstance(ctx context.Context, tasks []*task

// Run ecs.DescribeContainerInstances and ec2.DescribeInstances for a batch (less than 100 container instances).
func (f *taskFetcher) describeContainerInstances(ctx context.Context, instanceList []*string,
ci2EC2 map[string]*ec2.Instance) error {
ci2EC2 map[string]*ec2.Instance,
) error {
// Get container instances
res, err := f.ecs.DescribeContainerInstancesWithContext(ctx, &ecs.DescribeContainerInstancesInput{
Cluster: aws.String(f.cluster),
Expand Down
1 change: 0 additions & 1 deletion extension/observer/ecsobserver/internal/ecsmock/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type PageLimit struct {
DescribeServiceInput int // max 10
DescribeContainerInstanceInput int // max 100
DescribeInstanceOutput int // max 1000

}

func DefaultPageLimit() PageLimit {
Expand Down
2 changes: 1 addition & 1 deletion extension/observer/ecsobserver/sd.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (s *serviceDiscovery) runAndWriteFile(ctx context.Context) error {
return err
}
// NOTE: We assume the folder already exists and does NOT try to create one.
if err := os.WriteFile(s.cfg.ResultFile, b, 0600); err != nil {
if err := os.WriteFile(s.cfg.ResultFile, b, 0o600); err != nil {
return err
}
}
Expand Down
4 changes: 1 addition & 3 deletions extension/observer/ecsobserver/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ func trimEmptyValueByKeyPrefix(m map[string]string, prefix string) {
}
}

var (
invalidLabelCharRE = regexp.MustCompile(`[^a-zA-Z0-9_]`)
)
var invalidLabelCharRE = regexp.MustCompile(`[^a-zA-Z0-9_]`)

// Copied from https://github.com/prometheus/prometheus/blob/8d2a8f493905e46fe6181e8c1b79ccdfcbdb57fc/util/strutil/strconv.go#L40-L44
func sanitizeLabelName(s string) string {
Expand Down
9 changes: 5 additions & 4 deletions extension/observer/ecstaskobserver/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ import (

const runningStatus = "RUNNING"

var _ extension.Extension = (*ecsTaskObserver)(nil)
var _ observer.EndpointsLister = (*ecsTaskObserver)(nil)
var _ observer.Observable = (*ecsTaskObserver)(nil)
var (
_ extension.Extension = (*ecsTaskObserver)(nil)
_ observer.EndpointsLister = (*ecsTaskObserver)(nil)
_ observer.Observable = (*ecsTaskObserver)(nil)
)

type ecsTaskObserver struct {
extension.Extension
Expand Down Expand Up @@ -97,7 +99,6 @@ func (e *ecsTaskObserver) portFromLabels(labels map[string]string) uint16 {
for _, portLabel := range e.config.PortLabels {
if p, ok := labels[portLabel]; ok {
port, err := strconv.ParseUint(p, 10, 16)

if err != nil {
e.telemetry.Logger.Warn("failed parsing port label", zap.String("label", portLabel), zap.Error(err))
continue
Expand Down
Loading

0 comments on commit 8c73b4e

Please sign in to comment.