validate

package
v1.4.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVcsimInputConfig

func GetVcsimInputConfig(ctx context.Context, URL *url.URL) *data.Data

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 ParseURL

func ParseURL(s string) (*url.URL, error)

Starting from Go 1.8 the URL parser does not work properly with URLs with no Scheme, this function adds "https" as Scheme if necessary

func SetDataFromVM

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

SetDataFromVM set value based on VCH VM properties

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 FirewallConfigUnavailableError

type FirewallConfigUnavailableError struct {
	Host string
}

func (*FirewallConfigUnavailableError) Error

type FirewallMisconfiguredAllowedIPError

type FirewallMisconfiguredAllowedIPError struct {
	AllowedIPs []string
	Host       string
	Rule       types.HostFirewallRule
	TargetIP   net.IPNet
}

func (*FirewallMisconfiguredAllowedIPError) Error

type FirewallMisconfiguredError

type FirewallMisconfiguredError struct {
	Host string
	Rule types.HostFirewallRule
}

func (*FirewallMisconfiguredError) Error

type FirewallStatus

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

type FirewallUnknownDHCPAllowedIPError

type FirewallUnknownDHCPAllowedIPError struct {
	AllowedIPs []string
	Host       string
	Rule       types.HostFirewallRule
	TargetIP   net.IPNet
}

func (*FirewallUnknownDHCPAllowedIPError) Error

type Validator

type Validator struct {
	TargetPath        string
	DatacenterPath    string
	ClusterPath       string
	ResourcePoolPath  string
	ImageStorePath    string
	PublicNetworkPath string
	BridgeNetworkPath string
	BridgeNetworkName string

	Session *session.Session
	Context context.Context
	// contains filtered or unexported fields
}

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

func (v *Validator) AllowEmptyDC()

func (*Validator) AssertVersion

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

func (*Validator) CheckDRS

func (v *Validator) CheckDRS(ctx context.Context, input *data.Data)

CheckDRS will validate DRS settings. If DRS is disabled then config options surrounding resource pools will be ignored.

func (*Validator) CheckFirewall

func (v *Validator) CheckFirewall(ctx context.Context, conf *config.VirtualContainerHostConfigSpec)

CheckFirewall verifies that host firewall configuration allows tether traffic and outputs results

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

func (v *Validator) CheckIPInNets(checkIP net.IPNet, allowedIPs []string, allowedNets []string) bool

CheckIPInNets checks that an IP is within allowedIPs or allowedNets

func (*Validator) CheckLicense

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

CheckLicense checks license features on the Validator's target

func (*Validator) CheckPersistNetworkBacking

func (v *Validator) CheckPersistNetworkBacking(ctx context.Context, quiet bool) bool

check that PersistNetworkBacking is set

func (*Validator) ClearIssues

func (v *Validator) ClearIssues()

func (*Validator) ConfigureVCenter

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

FIXME ATC DEBT setting this value needs to be moved to Dispatcher https://github.com/vmware/vic/issues/6803 set PersistNetworkBacking key to "true"

func (*Validator) DatastoreHelper

func (v *Validator) DatastoreHelper(ctx context.Context, path string, label string, flag string) (*url.URL, *object.Datastore, error)

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

GetMgmtIP finds the management network IP in config

func (*Validator) IsVC

func (v *Validator) IsVC() bool

func (*Validator) ListComputeResource

func (v *Validator) ListComputeResource() ([]string, error)

func (*Validator) ListDatacenters

func (v *Validator) ListDatacenters() ([]string, error)

func (*Validator) ListDatastores

func (v *Validator) ListDatastores() ([]string, error)

func (*Validator) ListIssues

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

func (*Validator) ListResourcePool

func (v *Validator) ListResourcePool(path string) ([]string, error)

func (*Validator) ManagementNetAllowed

func (v *Validator) ManagementNetAllowed(ctx context.Context, mgmtIP net.IPNet,
	host *object.HostSystem, requiredRule types.HostFirewallRule) (bool, error)

ManagementNetAllowed checks if the management network is allowed based on the host firewall's allowed IP settings

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

func (v *Validator) SetDatastore(ds *object.Datastore, path *url.URL)

func (*Validator) Validate

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

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

func (*Validator) VcsimValidate

func (v *Validator) VcsimValidate(ctx context.Context, localInputConfig *data.Data) (*config.VirtualContainerHostConfigSpec, error)

This method allows to perform validation of a configuration when interacting with GO vmomi simulator, it skips some of the tests that otherwise would fail (e.g. Firewall)

Jump to

Keyboard shortcuts

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