Skip to content

Commit

Permalink
Remove missed otel code:
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
  • Loading branch information
jacobweinstock committed Oct 14, 2024
1 parent 06fc9f5 commit 7e1c1c3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/tink-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func NewRootCommand() *cobra.Command {

ctrl.SetLogger(logger)

mgr, err := controller.NewManager(cfg, options, logger)
mgr, err := controller.NewManager(cfg, options)
if err != nil {
return fmt.Errorf("controller manager: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ require (
github.com/stretchr/testify v1.9.0
github.com/tinkerbell/rufio v0.3.3
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0
go.opentelemetry.io/otel v1.30.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
google.golang.org/grpc v1.67.1
Expand Down Expand Up @@ -106,6 +105,7 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 // indirect
Expand Down
5 changes: 2 additions & 3 deletions internal/deprecated/controller/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package controller
import (
"fmt"

"github.com/go-logr/logr"
rufio "github.com/tinkerbell/rufio/api/v1alpha1"
"github.com/tinkerbell/tink/api/v1alpha1"
"github.com/tinkerbell/tink/internal/deprecated/workflow"
Expand All @@ -29,7 +28,7 @@ func DefaultScheme() *runtime.Scheme {

// NewManager creates a new controller manager with tink controller controllers pre-registered.
// If opts.Scheme is nil, DefaultScheme() is used.
func NewManager(cfg *rest.Config, opts ctrl.Options, logger logr.Logger) (ctrl.Manager, error) {
func NewManager(cfg *rest.Config, opts ctrl.Options) (ctrl.Manager, error) {
if opts.Scheme == nil {
opts.Scheme = DefaultScheme()
}
Expand All @@ -47,7 +46,7 @@ func NewManager(cfg *rest.Config, opts ctrl.Options, logger logr.Logger) (ctrl.M
return nil, fmt.Errorf("set up ready check: %w", err)
}

err = workflow.NewReconciler(mgr.GetClient(), logger).SetupWithManager(mgr)
err = workflow.NewReconciler(mgr.GetClient()).SetupWithManager(mgr)
if err != nil {
return nil, fmt.Errorf("setup workflow reconciler: %w", err)
}
Expand Down
8 changes: 1 addition & 7 deletions internal/deprecated/workflow/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"github.com/go-logr/logr"
"github.com/tinkerbell/tink/api/v1alpha1"
"github.com/tinkerbell/tink/internal/deprecated/workflow/journal"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/propagation"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -27,21 +25,17 @@ type Reconciler struct {
client ctrlclient.Client
nowFunc func() time.Time
backoff *backoff.ExponentialBackOff
Logger logr.Logger
props propagation.TextMapPropagator
}

// TODO(jacobweinstock): add functional arguments to the signature.
// TODO(jacobweinstock): write functional argument for customizing the backoff.
func NewReconciler(client ctrlclient.Client, logger logr.Logger) *Reconciler {
func NewReconciler(client ctrlclient.Client) *Reconciler {
return &Reconciler{
client: client,
nowFunc: time.Now,
backoff: backoff.NewExponentialBackOff([]backoff.ExponentialBackOffOpts{
backoff.WithMaxInterval(5 * time.Second), // this should keep all NextBackOff's under 10 seconds
}...),
Logger: logger,
props: otel.GetTextMapPropagator(),
}
}

Expand Down

0 comments on commit 7e1c1c3

Please sign in to comment.