root

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use: "kubeaid-core",

	PersistentPreRun: func(cmd *cobra.Command, args []string) {

		err := os.MkdirAll(constants.OutputLogsDirectory, 0o750)
		assert.AssertErrNil(cmd.Context(), err, "Failed ensuring that logs directory exists")

		logFilePath := filepath.Join(
			constants.OutputLogsDirectory,
			time.Now().UTC().Format(time.RFC3339)+".log",
		)
		logFile, err := os.OpenFile(logFilePath,
			os.O_CREATE|os.O_WRONLY|os.O_TRUNC,
			0o644,
		)
		if err != nil {
			log.Fatalf("Failed opening log file : %v", err)
		}

		logger.CreateLogger(globals.IsDebugModeEnabled, []io.Writer{logFile, os.Stdout})
	},

	RunE: func(cmd *cobra.Command, args []string) error {
		return cmd.Help()
	},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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