cmd

package
v0.9.237-test Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_PROTOCOL    = "tcp"
	DEFAULT_ADDRESS     = "0.0.0.0:8080"
	MAX_RETRIES         = 5
	CLIENT_RETRY_PERIOD = time.Second
)

Variables

View Source
var HelperCmd = &cobra.Command{
	Use:   "k8s-helper",
	Short: "Helper for running in Kubernetes",
	RunE: func(cmd *cobra.Command, args []string) error {
		ctx := cmd.Context()

		restart, _ := cmd.Flags().GetBool("restart")
		if restart {
			if err := runScript(ctx, restartScript, true); err != nil {
				return fmt.Errorf("error restarting: %w", err)
			}
		}

		setupHost, _ := cmd.Flags().GetBool("setup-host")
		if setupHost {
			if err := runScript(ctx, setupHostScript, true); err != nil {
				return fmt.Errorf("error setting up host: %w", err)
			}
		}

		startChroot, _ := cmd.Flags().GetBool("start-chroot")
		startChroot = startChroot || setupHost

		return startHelper(ctx, startChroot, DEFAULT_ADDRESS, DEFAULT_PROTOCOL)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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