system

package
v0.5.56 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrHealthCheckFailedCode        = "1000"
	ErrInvalidAdapterCode           = "1001"
	ErrDownloadFileCode             = "1002"
	ErrStopMesheryCode              = "1003"
	ErrResetMeshconfigCode          = "1004"
	ErrApplyManifestCode            = "1005"
	ErrApplyOperatorManifestCode    = "1006"
	ErrCreateDirCode                = "1007"
	ErrUnmarshalCode                = "1008"
	ErrUnsupportedPlatformCode      = "1009"
	ErrRetrievingCurrentContextCode = "1022"
	ErrSettingTemporaryContextCode  = "1023"
	ErrCreateManifestsFolderCode    = "1024"
	ErrProcessingMctlConfigCode     = "1025"
	ErrRestartMesheryCode           = "1026"
)

Variables

View Source
var ContextCmd = &cobra.Command{
	Use:   "context [command]",
	Short: "Configure your Meshery deployment(s)",
	Long:  `Configure and switch between different named Meshery server and adapter versions and deployments.`,
	Args:  cobra.MaximumNArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		if len(args) == 0 {
			currentContext := viper.GetString("current-context")
			if currentContext == "" {
				return errors.New("current context not set")
			}

			log.Printf("Current context: %s\n", currentContext)
			return cmd.Help()
		}

		if ok := utils.IsValidSubcommand(availableSubcommands, args[0]); !ok {
			return errors.New(utils.SystemError(fmt.Sprintf("invalid command: \"%s\"", args[0])))
		}
		return nil
	},
}

ContextCmd represents the context command

View Source
var SystemCmd = &cobra.Command{
	Use:   "system",
	Short: "Meshery Lifecycle Management",
	Long:  `Manage the state and configuration of Meshery server, adapters, and client.`,
	Args:  cobra.MinimumNArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		if ok := utils.IsValidSubcommand(availableSubcommands, args[0]); !ok {
			return errors.New(utils.SystemError(fmt.Sprintf("invalid command: \"%s\"", args[0])))
		}
		mctlCfg, err := config.GetMesheryCtl(viper.GetViper())
		if err != nil {
			return errors.Wrap(err, "error processing config")
		}
		mctlCfg.GetBaseMesheryURL()
		return nil
	},
}

SystemCmd represents Meshery Lifecycle Management cli commands

Functions

func ErrApplyManifest added in v0.5.46

func ErrApplyManifest(err error, deleteStatus, updateStatus bool) error

func ErrApplyOperatorManifest added in v0.5.46

func ErrApplyOperatorManifest(err error, deleteStatus, updateStatus bool) error

func ErrCreateDir added in v0.5.46

func ErrCreateDir(err error, obj string) error

func ErrCreateManifestsFolder added in v0.5.54

func ErrCreateManifestsFolder(err error) error

func ErrDownloadFile added in v0.5.39

func ErrDownloadFile(err error, obj string) error

func ErrHealthCheckFailed added in v0.5.39

func ErrHealthCheckFailed(err error) error

func ErrInvalidAdapter added in v0.5.39

func ErrInvalidAdapter(err error, obj string) error

func ErrProcessingMctlConfig added in v0.5.54

func ErrProcessingMctlConfig(err error) error

func ErrResetMeshconfig added in v0.5.46

func ErrResetMeshconfig(err error) error

func ErrRestartMeshery added in v0.5.54

func ErrRestartMeshery(err error) error

func ErrRetrievingCurrentContext added in v0.5.54

func ErrRetrievingCurrentContext(err error) error

func ErrSettingTemporaryContext added in v0.5.54

func ErrSettingTemporaryContext(err error) error

func ErrStopMeshery added in v0.5.46

func ErrStopMeshery(err error) error

func ErrUnmarshal added in v0.5.46

func ErrUnmarshal(err error, obj string) error

func ErrUnsupportedPlatform added in v0.5.46

func ErrUnsupportedPlatform(platform string, config string) error

func IsBetaOrStable added in v0.5.1

func IsBetaOrStable(str string) bool

IsBetaOrStable to determine which release channel is being used

func PrintChannelAndVersionToStdout added in v0.5.1

func PrintChannelAndVersionToStdout(ctx config.Context, contextName string) string

PrintChannelAndVersionToStdout to return curren release channel details

Types

type HealthCheckOptions added in v0.5.33

type HealthCheckOptions struct {
	// PrintLogs to keep incheck to print logs during a healthcheck
	PrintLogs bool
	// IsPreRunE to keep incheck if healthchecks are triggered as as a PreRunE
	IsPreRunE bool

	// the command under which the healthchecks are being triggered
	Subcommand string
	// if RunDockerChecks is true we run docker checks
	RunDockerChecks bool
	// if RunKubernetesChecks is true we run k8s checks
	RunKubernetesChecks bool
	// if RunOperatorChecks is true we run operator checks
	RunOperatorChecks bool
	// if RunVersionChecks is true we run version checks
	RunVersionChecks bool
	// if RunAdapterChecks is true we run adapter checks
	RunAdapterChecks bool
}

type HealthChecker added in v0.5.33

type HealthChecker struct {
	Options *HealthCheckOptions
	// contains filtered or unexported fields
}

func NewHealthChecker added in v0.5.33

func NewHealthChecker(options *HealthCheckOptions) (*HealthChecker, error)

func (*HealthChecker) Run added in v0.5.33

func (hc *HealthChecker) Run() error

Run triggers all the healthchecks according to the requirements defined from struct HealthChecks

func (*HealthChecker) RunPreflightHealthChecks added in v0.5.33

func (hc *HealthChecker) RunPreflightHealthChecks() error

Run preflight healthchecks to verify environment health

Jump to

Keyboard shortcuts

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