INNER CODE UNIT · Go
runNotifyUpgrade
nicholas-fedor/watchtower · cmd/notify-upgrade.go:52
func runNotifyUpgrade(cmd *cobra.Command, args []string) {
log := logging.New(os.Stderr, logging.InfoLevel)
log, err := runNotifyUpgradeE(cmd, args, log)
if err != nil {
log.Error().Err(err).Msg("Notification upgrade failed")
}
}
// runNotifyUpgradeE performs the core logic for the `notify-upgrade` subcommand, converting legacy Watchtower notification
// settings into shoutrrr URL format and managing the lifecycle of a temporary file to store these URLs.
//
// Parameters:
// - cmd: The *cobra.Command instance representing the `notify-upgrade` subcommand, providing access to parsed flags
// such as notification types (e.g., --notifications) and other settings that influence notifier behavior.
// - _: A slice of strings representing positional arguments, unused here as the command accepts no arguments (enforced
// by cobra.NoArgs), included for compatibility with Cobra's RunE signature.
// - log: Process logger, reconfigured from --log-format / --log-level so subcommand output honors those flags.