status

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MPL-2.0 Imports: 10 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 gitops control",
	Args:          cobra.MinimumNArgs(1),
	SilenceUsage:  true,
	SilenceErrors: true,
	Example:       "gitops app status podinfo",
	RunE: func(cmd *cobra.Command, args []string) error {
		ctx := context.Background()

		params := app.StatusParams{}

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

		log := internal.NewCLILogger(os.Stdout)
		fluxClient := flux.New(osys.New(), &runner.CLIRunner{})
		appFactory := services.NewFactory(fluxClient, log)
		appService, err := appFactory.GetAppService(ctx)
		if err != nil {
			return fmt.Errorf("failed to create app service: %w", err)
		}

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

		log.Printf("Last successful reconciliation: %s\n\n", lastSuccessReconciliation)
		log.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