Documentation ¶
Index ¶
- func GetVcsimInputConfig(ctx context.Context, URL *url.URL) *data.Data
- func NewDataFromConfig(ctx context.Context, finder Finder, ...) (d *data.Data, err error)
- func ParseURL(s string) (*url.URL, error)
- func SetDataFromVM(ctx context.Context, finder Finder, vm *vm.VirtualMachine, d *data.Data) error
- func VMGroupExists(op trace.Operation, cluster *object.ComputeResource, group string) (bool, error)
- type Finder
- type FirewallConfigUnavailableError
- type FirewallMisconfiguredAllowedIPError
- type FirewallMisconfiguredError
- type FirewallStatus
- type FirewallUnknownDHCPAllowedIPError
- type Validator
- func (v *Validator) AddDeprecatedFields(ctx context.Context, conf *config.VirtualContainerHostConfigSpec, ...) *data.InstallerData
- func (v *Validator) AllowEmptyDC()
- func (v *Validator) AssertVersion(ctx context.Context, conf *config.VirtualContainerHostConfigSpec) (err error)
- func (v *Validator) CheckDRS(ctx context.Context, input *data.Data)
- func (v *Validator) CheckFirewall(ctx context.Context, conf *config.VirtualContainerHostConfigSpec)
- func (v *Validator) CheckFirewallForTether(ctx context.Context, mgmtIP net.IPNet) FirewallStatus
- func (v *Validator) CheckIPInNets(checkIP net.IPNet, allowedIPs []string, allowedNets []string) bool
- func (v *Validator) CheckLicense(ctx context.Context)
- func (v *Validator) CheckPersistNetworkBacking(ctx context.Context, quiet bool) bool
- func (v *Validator) ClearIssues()
- func (v *Validator) ConfigureVCenter(ctx context.Context) error
- func (v *Validator) DatastoreHelper(ctx context.Context, path string, label string, flag string) (*url.URL, *object.Datastore, error)
- func (v *Validator) FirewallCheckOutput(ctx context.Context, status FirewallStatus)
- func (v *Validator) GetIssues() []error
- func (v *Validator) GetMgmtIP(conf *config.VirtualContainerHostConfigSpec) net.IPNet
- func (v *Validator) IsVC() bool
- func (v *Validator) ListComputeResource() ([]string, error)
- func (v *Validator) ListDatacenters() ([]string, error)
- func (v *Validator) ListDatastores() ([]string, error)
- func (v *Validator) ListIssues(ctx context.Context) error
- func (v *Validator) ListResourcePool(path string) ([]string, error)
- func (v *Validator) ManagementNetAllowed(ctx context.Context, mgmtIP net.IPNet, host *object.HostSystem, ...) (bool, error)
- func (v *Validator) NoteIssue(err error)
- func (v *Validator) ResourcePoolHelper(ctx context.Context, path string) (*object.ResourcePool, error)
- func (v *Validator) SetDatastore(ds *object.Datastore, path *url.URL)
- func (v *Validator) Validate(ctx context.Context, input *data.Data) (*config.VirtualContainerHostConfigSpec, error)
- func (v *Validator) ValidateCompute(ctx context.Context, input *data.Data, computeRequired bool) (*config.VirtualContainerHostConfigSpec, error)
- func (v *Validator) ValidateMigratedConfig(ctx context.Context, conf *config.VirtualContainerHostConfigSpec) (*config.VirtualContainerHostConfigSpec, error)
- func (v *Validator) ValidateTarget(ctx context.Context, input *data.Data) (*config.VirtualContainerHostConfigSpec, error)
- func (v *Validator) VcsimValidate(ctx context.Context, localInputConfig *data.Data) (*config.VirtualContainerHostConfigSpec, error)
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 ParseURL ¶
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 ¶
SetDataFromVM set value based on VCH VM properties
func VMGroupExists ¶
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 {
}func (*FirewallConfigUnavailableError) Error ¶
func (e *FirewallConfigUnavailableError) Error() string
type FirewallMisconfiguredAllowedIPError ¶
type FirewallMisconfiguredAllowedIPError struct { AllowedIPs []string Host string Rule types.HostFirewallRule TargetIP net.IPNet }
func (*FirewallMisconfiguredAllowedIPError) Error ¶
func (e *FirewallMisconfiguredAllowedIPError) Error() string
type FirewallMisconfiguredError ¶
type FirewallMisconfiguredError struct { Host string Rule types.HostFirewallRule }
func (*FirewallMisconfiguredError) Error ¶
func (e *FirewallMisconfiguredError) Error() string
type FirewallStatus ¶
type FirewallUnknownDHCPAllowedIPError ¶
type FirewallUnknownDHCPAllowedIPError struct { AllowedIPs []string Host string Rule types.HostFirewallRule TargetIP net.IPNet }
func (*FirewallUnknownDHCPAllowedIPError) Error ¶
func (e *FirewallUnknownDHCPAllowedIPError) Error() string
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 CreateFromVCHConfig ¶
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 (*Validator) CheckDRS ¶
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 ¶
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 ¶
CheckLicense checks license features on the Validator's target
func (*Validator) CheckPersistNetworkBacking ¶
check that PersistNetworkBacking is set
func (*Validator) ClearIssues ¶
func (v *Validator) ClearIssues()
func (*Validator) ConfigureVCenter ¶
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 (*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) GetMgmtIP ¶
func (v *Validator) GetMgmtIP(conf *config.VirtualContainerHostConfigSpec) net.IPNet
GetMgmtIP finds the management network IP in config
func (*Validator) ListComputeResource ¶
func (*Validator) ListDatacenters ¶
func (*Validator) ListDatastores ¶
func (*Validator) ListResourcePool ¶
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) 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 (*Validator) Validate ¶
func (v *Validator) Validate(ctx context.Context, input *data.Data) (*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 (*Validator) ValidateMigratedConfig ¶
func (v *Validator) ValidateMigratedConfig(ctx context.Context, conf *config.VirtualContainerHostConfigSpec) (*config.VirtualContainerHostConfigSpec, error)
MigrateConfig migrate old VCH configuration to new version. Currently check required fields only
func (*Validator) ValidateTarget ¶
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)