mirror of
https://github.com/hanzoai/traces.git
synced 2026-11-03 04:05:45 +00:00
* Update bunch of module and code Signed-off-by: debasishbsws <[email protected]> * Update Changelog Signed-off-by: debasishbsws <[email protected]> * remove named argument and do go mod tidy in tempo-serveless Signed-off-by: debasishbsws <[email protected]> --------- Signed-off-by: debasishbsws <[email protected]>
32 lines
847 B
Go
32 lines
847 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package otelcol // import "go.opentelemetry.io/collector/otelcol"
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// newValidateSubCommand constructs a new validate sub command using the given CollectorSettings.
|
|
func newValidateSubCommand(set CollectorSettings, flagSet *flag.FlagSet) *cobra.Command {
|
|
validateCmd := &cobra.Command{
|
|
Use: "validate",
|
|
Short: "Validates the config without running the collector",
|
|
Args: cobra.ExactArgs(0),
|
|
RunE: func(cmd *cobra.Command, _ []string) error {
|
|
if err := updateSettingsUsingFlags(&set, flagSet); err != nil {
|
|
return err
|
|
}
|
|
col, err := NewCollector(set)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return col.DryRun(cmd.Context())
|
|
},
|
|
}
|
|
validateCmd.Flags().AddGoFlagSet(flagSet)
|
|
return validateCmd
|
|
}
|