refresh

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = cli.Command{
	Name:   "refresh",
	Flags:  Flags,
	Action: clitools.CheckGlobalRequired(refreshCertificates, global.RequiredFlags),
	Usage:  "Periodically check and refresh certificates for cockroach node or client.",
}
View Source
var Flags = []cli.Flag{
	cli.IntFlag{
		Name:   "max-attempts",
		EnvVar: "MAX_ATTEMPTS",
		Value:  3,
		Usage:  "Maximum number of attempts to try to fetch new certificate.",
	},
	cli.DurationFlag{
		Name:   "extra-time",
		EnvVar: "EXTRA_TIME",
		Value:  time.Minute * 5,
		Usage: "Time by which we shorten the expiration to have time to get new certificates." +
			"This should be a positive duration.",
	},
	cli.StringFlag{
		Name:   "target-proc-command",
		EnvVar: "TARGET_PROC_COMMAND",
		Value:  "cockroach",
		Usage: "Substring of a command used to run the executable that" +
			"should be signalled to when a new certificate is retrieved.",
	},
	cli.StringFlag{
		Name:   "signal",
		EnvVar: "SIGNAL",
		Value:  "SIGHUP",
		Usage: "Signal to be send to the main process, when the certificates are refreshed. " +
			`Allowed values are "SIGHUP", "SIGTERM" and "SIGINT".`,
	},
	cli.DurationFlag{
		Name:   "max-random-sleep",
		EnvVar: "MAX_RANDOM_SLEEP",
		Value:  time.Duration(0),
		Usage: "Maximum random sleep time before sending the signal to the main process. " +
			"This is to prevent all containers being restarted at the same time.",
	},
}

Functions

This section is empty.

Types

type Refresher

type Refresher interface {
	Run(*cli.Context) error
}

Refresher is an object that reads and refreshes an ssl certificate when run

func NewRefresher

func NewRefresher(c *cli.Context) (Refresher, error)

NewRefresher returns a new instance of a Refresher or an error if an instance can't be created from provided context

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL