status

package
v0.2.3-rc.3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:           "status <app-name>",
	Short:         "Get status of a workload under wego control",
	Args:          cobra.MinimumNArgs(1),
	SilenceUsage:  true,
	SilenceErrors: true,
	Example:       "wego app status podinfo",
	RunE: func(cmd *cobra.Command, args []string) error {
		params := app.StatusParams{}

		params.Name = args[0]
		params.Namespace, _ = cmd.Parent().Parent().Flags().GetString("namespace")

		cliRunner := &runner.CLIRunner{}
		osysClient := osys.New()
		fluxClient := flux.New(osysClient, cliRunner)
		kubeClient, err := kube.NewKubeHTTPClient()
		if err != nil {
			return fmt.Errorf("error initializing kube client: %w", err)
		}

		gitClient := git.New(nil, wrapper.NewGoGit())
		logger := logger.NewCLILogger(os.Stdout)

		appService := app.New(logger, gitClient, fluxClient, kubeClient, osysClient)

		fluxOutput, lastSuccessReconciliation, err := appService.Status(params)
		if err != nil {
			return fmt.Errorf("failed getting application status: %w", err)
		}

		logger.Printf("Last successful reconciliation: %s\n\n", lastSuccessReconciliation)
		logger.Println(fluxOutput)

		return nil
	},
}

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