Files
Debasish BiswasandGitHub 2ddf2c9542 update the opentelemetry module version from 0.97.0 to 0.102.1 (#3784)
* 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]>
2024-06-19 19:17:18 +02:00

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
}