Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] unexport updateCollectorStatus function #3639

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/status/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/open-telemetry/opentelemetry-operator/internal/version"
)

func UpdateCollectorStatus(ctx context.Context, cli client.Client, changed *v1beta1.OpenTelemetryCollector) error {
func updateCollectorStatus(ctx context.Context, cli client.Client, changed *v1beta1.OpenTelemetryCollector) error {
if changed.Status.Version == "" {
// a version is not set, otherwise let the upgrade mechanism take care of it!
changed.Status.Version = version.OpenTelemetryCollector()
Expand Down
8 changes: 4 additions & 4 deletions internal/status/collector/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestUpdateCollectorStatusUnsupported(t *testing.T) {
},
}

err := UpdateCollectorStatus(ctx, cli, changed)
err := updateCollectorStatus(ctx, cli, changed)
assert.NoError(t, err)

assert.Equal(t, int32(0), changed.Status.Scale.Replicas, "expected replicas to be 0")
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestUpdateCollectorStatusDeploymentMode(t *testing.T) {
},
}

err := UpdateCollectorStatus(ctx, cli, changed)
err := updateCollectorStatus(ctx, cli, changed)
assert.NoError(t, err)

assert.Equal(t, int32(1), changed.Status.Scale.Replicas, "expected replicas to be 1")
Expand Down Expand Up @@ -137,7 +137,7 @@ func TestUpdateCollectorStatusStatefulset(t *testing.T) {
},
}

err := UpdateCollectorStatus(ctx, cli, changed)
err := updateCollectorStatus(ctx, cli, changed)
assert.NoError(t, err)

assert.Equal(t, int32(1), changed.Status.Scale.Replicas, "expected replicas to be 1")
Expand Down Expand Up @@ -184,7 +184,7 @@ func TestUpdateCollectorStatusDaemonsetMode(t *testing.T) {
},
}

err := UpdateCollectorStatus(ctx, cli, changed)
err := updateCollectorStatus(ctx, cli, changed)
assert.NoError(t, err)

assert.Contains(t, changed.Status.Scale.Selector, "customLabel=customValue", "expected selector to contain customlabel=customValue")
Expand Down
2 changes: 1 addition & 1 deletion internal/status/collector/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func HandleReconcileStatus(ctx context.Context, log logr.Logger, params manifest
log.V(2).Error(upgradeErr, "failed to upgrade the OpenTelemetry CR")
}
changed = &upgraded
statusErr := UpdateCollectorStatus(ctx, params.Client, changed)
statusErr := updateCollectorStatus(ctx, params.Client, changed)
if statusErr != nil {
params.Recorder.Event(changed, eventTypeWarning, reasonStatusFailure, statusErr.Error())
return ctrl.Result{}, statusErr
Expand Down
Loading