Skip to content

Commit

Permalink
bump opamp version (#2569)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronoff97 authored Jan 29, 2024
1 parent 29bafee commit ee8db9d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cmd/operator-opamp-bridge/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ func (agent *Agent) generateCollectorHealth(selectorLabels map[string]string, na
}

// onConnect is called when an agent is successfully connected to a server.
func (agent *Agent) onConnect() {
func (agent *Agent) onConnect(ctx context.Context) {
agent.logger.V(3).Info("Connected to the server.")
}

// onConnectFailed is called when an agent was unable to connect to a server.
func (agent *Agent) onConnectFailed(err error) {
func (agent *Agent) onConnectFailed(ctx context.Context, err error) {
agent.logger.Error(err, "failed to connect to the server")
}

// onError is called when an agent receives an error response from the server.
func (agent *Agent) onError(err *protobufs.ServerErrorResponse) {
func (agent *Agent) onError(ctx context.Context, err *protobufs.ServerErrorResponse) {
agent.logger.Error(fmt.Errorf(err.GetErrorMessage()), "server returned an error response")
}

Expand Down
4 changes: 4 additions & 0 deletions cmd/operator-opamp-bridge/agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ type mockOpampClient struct {
settings types.StartSettings
}

func (m *mockOpampClient) RequestConnectionSettings(request *protobufs.ConnectionSettingsRequest) error {
return nil
}

func (m *mockOpampClient) Start(_ context.Context, settings types.StartSettings) error {
m.settings = settings
return nil
Expand Down
5 changes: 3 additions & 2 deletions cmd/operator-opamp-bridge/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package logger

import (
"context"
"fmt"

"github.com/go-logr/logr"
Expand All @@ -31,10 +32,10 @@ func NewLogger(logger logr.Logger) *Logger {
return &Logger{Logger: logger}
}

func (l *Logger) Debugf(format string, v ...interface{}) {
func (l *Logger) Debugf(ctx context.Context, format string, v ...interface{}) {
l.Logger.V(4).Info(fmt.Sprintf(format, v...))
}

func (l *Logger) Errorf(format string, v ...interface{}) {
func (l *Logger) Errorf(ctx context.Context, format string, v ...interface{}) {
l.Logger.V(0).Error(nil, fmt.Sprintf(format, v...))
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/oklog/run v1.1.0
github.com/oklog/ulid/v2 v2.1.0
github.com/open-telemetry/opamp-go v0.10.0
github.com/open-telemetry/opamp-go v0.12.0
github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e
github.com/operator-framework/operator-lib v0.12.0
github.com/prometheus-operator/prometheus-operator v0.71.0
Expand Down Expand Up @@ -123,7 +123,7 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gophercloud/gophercloud v1.7.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/hashicorp/consul/api v1.25.1 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ github.com/gophercloud/gophercloud v1.7.0 h1:fyJGKh0LBvIZKLvBWvQdIgkaV5yTM3Jh9EY
github.com/gophercloud/gophercloud v1.7.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww=
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
Expand Down Expand Up @@ -516,6 +518,8 @@ github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/open-telemetry/opamp-go v0.10.0 h1:3PdhoKcKY1lPrfdXnsxeLlXluE+Xe1Uc/CpJ4I8uUJ0=
github.com/open-telemetry/opamp-go v0.10.0/go.mod h1:Pfmm5EdWqZCG0dZAJjAinlra3yEpqK5StCblxpbEp6Q=
github.com/open-telemetry/opamp-go v0.12.0 h1:N97R8BY5FfaB9SzG5pURrOfXQk7MT9a4RD8oERlii5o=
github.com/open-telemetry/opamp-go v0.12.0/go.mod h1:bk3WZ4RjbVdzsHT3gaPZscUdGvoz9Bi2+AvG8/5X824=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
Expand Down

0 comments on commit ee8db9d

Please sign in to comment.