Skip to content

Commit

Permalink
feat: support log level in cmp plugin, and add possibility to trace g…
Browse files Browse the repository at this point in the history
…enerated manifest

Signed-off-by: pashakostohrys <[email protected]>
  • Loading branch information
pasha-codefresh committed Jun 28, 2024
1 parent dafb37c commit b39d971
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/argocd-cmp-server/commands/argocd_cmp_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func NewCommand() *cobra.Command {
},
}

command.Flags().StringVar(&cmdutil.LogFormat, "logformat", "text", "Set the logging format. One of: text|json")
command.Flags().StringVar(&cmdutil.LogLevel, "loglevel", "info", "Set the logging level. One of: debug|info|warn|error")
command.Flags().StringVar(&cmdutil.LogFormat, "logformat", env.StringFromEnv("ARGOCD_CMP_SERVER_LOGFORMAT", "text"), "Set the logging format. One of: text|json")
command.Flags().StringVar(&cmdutil.LogLevel, "loglevel", env.StringFromEnv("ARGOCD_CMP_SERVER_LOGLEVEL", "info"), "Set the logging level. One of: trace|debug|info|warn|error")
command.Flags().StringVar(&configFilePath, "config-dir-path", common.DefaultPluginConfigFilePath, "Config management plugin configuration file location, Default is '/home/argocd/cmp-server/config/'")
command.Flags().StringVar(&otlpAddress, "otlp-address", env.StringFromEnv("ARGOCD_CMP_SERVER_OTLP_ADDRESS", ""), "OpenTelemetry collector address to send traces to")
command.Flags().BoolVar(&otlpInsecure, "otlp-insecure", env.ParseBoolFromEnv("ARGOCD_CMP_SERVER_OTLP_INSECURE", true), "OpenTelemetry collector insecure mode")
Expand Down
3 changes: 3 additions & 0 deletions cmpserver/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ func (s *Service) generateManifestGeneric(stream GenerateManifestStream) error {
if err != nil {
return fmt.Errorf("error generating manifests: %w", err)
}

log.Tracef("Generated manifests result: %s", response.Manifests)

err = stream.SendAndClose(response)
if err != nil {
return fmt.Errorf("error sending manifest response: %w", err)
Expand Down

0 comments on commit b39d971

Please sign in to comment.