checks

package
v1.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func NewAgentParametersCheck

func NewAgentParametersCheck() *parameterCheck

func NewEnterpriseRegistrationCheck

func NewEnterpriseRegistrationCheck() *enterpriseRegistrationCheck

func NewRelayConnectivityCheck

func NewRelayConnectivityCheck(
	preinstall bool,
) *relayConnectivityCheck

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 AgentParams

type AgentParams struct {
	RelayServerAddress string
	RelayAuthority     string
	Insecure           bool

	RootCertSecretRef   client.ObjectKey
	ClientCertSecretRef client.ObjectKey
}

agent install/upgrade parameters

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
	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

	RelayDialer RelayDialer
	AgentParams *AgentParams

	CrdMetadata map[string]*crdutils.CRDMetadata

	// k8s clients
	AppsClientset           appsv1.Clientset
	CoreClientset           corev1.Clientset
	NetworkingClientset     networkingv1.Clientset
	KubernetesClusterClient skv2multiclusterv1alpha1.KubernetesClusterClient
	CrdClient               apiextv1beta1.CustomResourceDefinitionClient
}

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 RelayDialer

type RelayDialer interface {
	DialIdentity(
		ctx context.Context,
		relayServerDialOpts grpcutils.DialOpts,
		secretClient v1.SecretClient,
		rootCertSecretRef client.ObjectKey,
	) error

	DialServer(
		ctx context.Context,
		relayServerDialOpts grpcutils.DialOpts,
	) error
}

func NewRelayDialer

func NewRelayDialer() RelayDialer

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 Stage

type Stage string

Directories

Path Synopsis
Package mock_checks is a generated GoMock package.
Package mock_checks is a generated GoMock package.

Jump to

Keyboard shortcuts

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