Skip to content

Commit

Permalink
[chore] inline code called once (#3638)
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme authored Feb 4, 2025
1 parent 8e6f2d0 commit 654875e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 70 deletions.
7 changes: 3 additions & 4 deletions internal/status/opampbridge/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/open-telemetry/opentelemetry-operator/internal/manifests"
"github.com/open-telemetry/opentelemetry-operator/internal/version"
)

const (
Expand All @@ -43,10 +44,8 @@ func HandleReconcileStatus(ctx context.Context, log logr.Logger, params manifest
}
changed := params.OpAMPBridge.DeepCopy()

statusErr := UpdateOpAMPBridgeStatus(ctx, params.Client, changed)
if statusErr != nil {
params.Recorder.Event(changed, eventTypeWarning, reasonStatusFailure, statusErr.Error())
return ctrl.Result{}, statusErr
if changed.Status.Version == "" {
changed.Status.Version = version.OperatorOpAMPBridge()
}
statusPatch := client.MergeFrom(&params.OpAMPBridge)
if err := params.Client.Status().Patch(ctx, changed, statusPatch); err != nil {
Expand Down
31 changes: 0 additions & 31 deletions internal/status/opampbridge/opampbridge.go

This file was deleted.

7 changes: 3 additions & 4 deletions internal/status/targetallocator/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/open-telemetry/opentelemetry-operator/internal/manifests/targetallocator"
"github.com/open-telemetry/opentelemetry-operator/internal/version"
)

const (
Expand All @@ -43,10 +44,8 @@ func HandleReconcileStatus(ctx context.Context, log logr.Logger, params targetal
}
changed := params.TargetAllocator.DeepCopy()

statusErr := UpdateTargetAllocatorStatus(ctx, params.Client, changed)
if statusErr != nil {
params.Recorder.Event(changed, eventTypeWarning, reasonStatusFailure, statusErr.Error())
return ctrl.Result{}, statusErr
if changed.Status.Version == "" {
changed.Status.Version = version.TargetAllocator()
}
statusPatch := client.MergeFrom(&params.TargetAllocator)
if err := params.Client.Status().Patch(ctx, changed, statusPatch); err != nil {
Expand Down
31 changes: 0 additions & 31 deletions internal/status/targetallocator/targetallocator.go

This file was deleted.

0 comments on commit 654875e

Please sign in to comment.