Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-bradley committed Jan 12, 2024
1 parent 57fcaa2 commit 21ee243
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions cmd/opampsupervisor/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,12 @@ func (s *Supervisor) getBootstrapInfo() (err error) {
},
onMessageFunc: func(_ serverTypes.Connection, message *protobufs.AgentToServer) {
if message.AgentDescription != nil {
instanceIdSeen := false
instanceIDSeen := false
s.agentDescription = message.AgentDescription
identAttr := s.agentDescription.IdentifyingAttributes

for _, attr := range identAttr {
switch attr.Key {
case semconv.AttributeServiceInstanceID:
if attr.Key == semconv.AttributeServiceInstanceID {
// TODO: Consider whether to attempt restarting the Collector.
// https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/29864
if attr.Value.GetStringValue() != s.instanceID.String() {
Expand All @@ -255,11 +254,11 @@ func (s *Supervisor) getBootstrapInfo() (err error) {
s.instanceID.String())
return
}
instanceIdSeen = true
instanceIDSeen = true
}
}

if !instanceIdSeen {
if !instanceIDSeen {
done <- errors.New("the Collector did not specify an instance ID in its AgentDescription message")
return
}
Expand Down Expand Up @@ -293,7 +292,7 @@ func (s *Supervisor) getBootstrapInfo() (err error) {
} else {
return errors.New("collector's OpAMP client never connected to the Supervisor")
}
case err := <-done:
case err = <-done:
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/opampsupervisor/supervisor/supervisor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Test_composeEffectiveConfig(t *testing.T) {
},
}

s.createTemplates()
require.NoError(t, s.createTemplates())
s.loadAgentEffectiveConfig()

configChanged, err := s.composeEffectiveConfig(&protobufs.AgentRemoteConfig{
Expand Down

0 comments on commit 21ee243

Please sign in to comment.