Skip to content

Commit

Permalink
revert to not use getParams
Browse files Browse the repository at this point in the history
  • Loading branch information
taniyourstruly committed Aug 29, 2024
1 parent 5dcfa35 commit b6f0911
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions controllers/opentelemetrycollector_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ type Params struct {
func (r *OpenTelemetryCollectorReconciler) Validate(otelcol v1beta1.OpenTelemetryCollector) admission.Warnings {
var warnings admission.Warnings

params, err := r.getParams(otelcol)
if err != nil {
warnings = append(warnings, err.Error())
return warnings
cfg := config.New(
config.WithCollectorImage("default-collector"),
config.WithTargetAllocatorImage("default-ta-allocator"),
)
params := manifests.Params{
Log: logr.Discard(),
Config: cfg,
OtelCol: otelcol,
}

_, err = collector.Build(params)
_, err := collector.Build(params)
if err != nil {
warnings = append(warnings, err.Error())
return warnings
Expand Down

0 comments on commit b6f0911

Please sign in to comment.