validate

package
v1.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDataFromConfig

func NewDataFromConfig(ctx context.Context, finder Finder, conf *config.VirtualContainerHostConfigSpec) (d *data.Data, err error)

NewDataFromConfig converts VirtualContainerHostConfigSpec back to data.Data object This method does not touch any configuration for VCH VM or resource pool, which should be retrieved from VM attributes

func NewSession added in v1.5.0

func NewSession(ctx context.Context, input *data.Data) (*session.Session, error)

func NewSessionConfig added in v1.5.0

func NewSessionConfig(ctx context.Context, input *data.Data) (*session.Config, error)

func VMGroupExists

func VMGroupExists(op trace.Operation, cluster *object.ComputeResource, group string) (bool, error)

Types

type Finder

type Finder interface {
	ObjectReference(ctx context.Context, ref types.ManagedObjectReference) (object.Reference, error)
}

Finder is defined for easy to test

type FirewallStatus

type FirewallStatus struct {
	Rule                          types.HostFirewallRule
	MisconfiguredEnabled          []string
	MisconfiguredDisabled         []string
	UnknownEnabled                []string
	UnknownDisabled               []string
	MisconfiguredAllowedIPEnabled []string
	Correct                       []string
}

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

func CreateFromSession added in v1.5.0

func CreateFromSession(ctx context.Context, sess *session.Session) (*Validator, error)

func NewValidator

func NewValidator(ctx context.Context, input *data.Data) (*Validator, error)

func (*Validator) AddDeprecatedFields

func (v *Validator) AddDeprecatedFields(ctx context.Context, conf *config.VirtualContainerHostConfigSpec, input *data.Data) *data.InstallerData

func (*Validator) AssertVersion

func (v *Validator) AssertVersion(ctx context.Context, conf *config.VirtualContainerHostConfigSpec) (err error)

func (*Validator) CheckFirewallForTether

func (v *Validator) CheckFirewallForTether(ctx context.Context, mgmtIP net.IPNet) FirewallStatus

CheckFirewallForTether which host firewalls are configured to allow tether traffic

func (*Validator) CheckLicense

func (v *Validator) CheckLicense(ctx context.Context)

CheckLicense checks license features on the Validator's target

func (*Validator) ClearIssues

func (v *Validator) ClearIssues()

func (*Validator) FirewallCheckOutput

func (v *Validator) FirewallCheckOutput(ctx context.Context, status FirewallStatus)

FirewallCheckOutput outputs firewall status messages associated with the hosts in each of the status categories

func (*Validator) GetIssues

func (v *Validator) GetIssues() []error

func (*Validator) ListIssues

func (v *Validator) ListIssues(ctx context.Context) error

func (*Validator) NoteIssue

func (v *Validator) NoteIssue(err error)

func (*Validator) ResourcePoolHelper

func (v *Validator) ResourcePoolHelper(ctx context.Context, path string) (*object.ResourcePool, error)

ResourcePoolHelper finds a resource pool from the input compute path and shows suggestions if unable to do so when the path is ambiguous.

func (*Validator) Session

func (v *Validator) Session() *session.Session

func (*Validator) SetDataFromVM added in v1.5.0

func (v *Validator) SetDataFromVM(ctx context.Context, vm *vm.VirtualMachine, d *data.Data) error

SetDataFromVM set value based on VCH VM properties

func (*Validator) Validate

func (v *Validator) Validate(ctx context.Context, input *data.Data, allowEmptyDC bool) (*config.VirtualContainerHostConfigSpec, error)

Validate runs through various validations, starting with basics such as naming, moving onto vSphere entities and then the compatibility between those entities. It assembles a set of issues that are found for reporting.

func (*Validator) ValidateCompute

func (v *Validator) ValidateCompute(ctx context.Context, input *data.Data, computeRequired bool) (*config.VirtualContainerHostConfigSpec, error)

func (*Validator) ValidateMigratedConfig

MigrateConfig migrate old VCH configuration to new version. Currently check required fields only

func (*Validator) ValidateStorageQuota added in v1.5.0

func (v *Validator) ValidateStorageQuota(ctx context.Context, quotaGB int, conf *config.VirtualContainerHostConfigSpec, vch *vm.VirtualMachine) (int64, error)

func (*Validator) ValidateTarget

func (v *Validator) ValidateTarget(ctx context.Context, input *data.Data, allowEmptyDC bool) (*config.VirtualContainerHostConfigSpec, error)

Jump to

Keyboard shortcuts

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