MCPcopy
hub / github.com/grafana/tempo / outputMigratedConfig

Function outputMigratedConfig

cmd/tempo-cli/cmd-migrate-config.go:392–405  ·  view source on GitHub ↗

outputMigratedConfig marshals the map to YAML and prints it to stdout with a header comment.

(m map[string]interface{})

Source from the content-addressed store, hash-verified

390
391// outputMigratedConfig marshals the map to YAML and prints it to stdout with a header comment.
392func outputMigratedConfig(m map[string]interface{}) error {
393 yamlBytes, err := yaml.Marshal(m)
394 if err != nil {
395 return fmt.Errorf("failed to marshal migrated config: %w", err)
396 }
397
398 var sb strings.Builder
399 sb.WriteString("# Generated by tempo-cli migrate config\n")
400 sb.WriteString("# Review before deploying. Remove compaction_disabled after decommissioning 2.x.\n")
401 sb.Write(yamlBytes)
402
403 fmt.Print(sb.String())
404 return nil
405}
406
407// setNestedValue sets a value at a path of keys in a nested map structure,
408// creating intermediate maps as needed without overwriting existing ones.

Callers 1

RunMethod · 0.85

Calls 3

MarshalMethod · 0.65
WriteMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected