checks

package
v1.1.0-beta28 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PreInstall  Stage = "pre-install"
	PostInstall       = "post-install"
	PreUpgrade        = "pre-upgrade"
	PostUpgrade       = "post-upgrade"

	// Test includes all post-install checks, and may include more checks that are make sure
	// that all is well with the system (for example, run some pre-install checks to verify the
	// environment is still OK).
	Test = "test"
)

Variables

This section is empty.

Functions

func NewEnterpriseRegistrationCheck

func NewEnterpriseRegistrationCheck() *enterpriseRegistrationCheck

func NewServerParametersCheck

func NewServerParametersCheck() *parameterCheck

func RunChecks

func RunChecks(ctx context.Context, checkCtx CheckContext, c Component, st Stage) bool

invoked by either meshctl or Helm hooks execute the checks for the given component and stage, and return true if a failure was found

Types

type Category

type Category struct {
	Name   string
	Checks []Check
}

type Check

type Check interface {
	// description of what is being checked
	GetDescription() string

	// Execute the check, pass in the namespace that Gloo Mesh is installed in
	Run(ctx context.Context, checkCtx CheckContext) *Result
}

func NewCrdUpgradeCheck

func NewCrdUpgradeCheck(deployment string) Check

func NewDeploymentsCheck

func NewDeploymentsCheck() Check

func NewNetworkingCrdCheck

func NewNetworkingCrdCheck() Check

type CheckContext

type CheckContext interface {
	Environment() Environment
	Client() client.Client
	AccessAdminPort(ctx context.Context, deployment string, op OperateOnAdminPort) (error, string)
	Context() CommonContext
	CRDMetadata(ctx context.Context, deploymentName string) (*crdutils.CRDMetadata, error)
}

type CommonContext

type CommonContext struct {
	// if true, skip checks
	SkipChecks bool

	Env Environment
	Cli client.Client
	// server install or upgrade parameters
	ServerParams *ServerParams
}

func (*CommonContext) Client

func (c *CommonContext) Client() client.Client

func (*CommonContext) Environment

func (c *CommonContext) Environment() Environment

type Component

type Component string
const (
	Server Component = "server"
	Agent            = "agent"
)

type Environment

type Environment struct {
	// Gloo Mesh management plane metrics port
	AdminPort uint32
	// the Gloo Mesh installation namespace
	Namespace string
	// true if this validation check is being run from an in-cluster workload
	InCluster bool
}

type Hint

type Hint struct {
	// an optional suggestion for a next action for the user to take for resolving a failed check
	Hint string
	// optionally provide a link to a docs page that a user should consult to resolve the error
	DocsLink *url.URL
}

type OperateOnAdminPort

type OperateOnAdminPort = func(ctx context.Context, adminUrl *url.URL) (error, string)

type Result

type Result struct {
	// user-facing error message describing failed check
	Errors []error

	// an optional suggestion for a next action for the user to take for resolving a failed check or warning
	Hints []Hint
}

func (*Result) AddError

func (f *Result) AddError(err ...error) *Result

func (*Result) AddHint

func (f *Result) AddHint(hint string, docsLink string) *Result

add a hint with an optional docs link

func (*Result) IsFailure

func (f *Result) IsFailure() bool

result is a failure if there are any errors

func (*Result) IsSuccess

func (f *Result) IsSuccess() bool

result is a success if nil or no errors and no hints

func (*Result) IsWarning

func (f *Result) IsWarning() bool

result is a warning if there are no errors but there are hints

type ServerParams

type ServerParams struct {
	RelayServerAddress string
}

type Stage

type Stage string

Jump to

Keyboard shortcuts

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