validate

package
v0.9.0-master Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package validate contains validation utilities for installer types.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ValidNetworkTypes is a collection of the valid network types.
	ValidNetworkTypes = map[netopv1.NetworkType]bool{
		netopv1.NetworkTypeOpenshiftSDN:  true,
		netopv1.NetworkTypeOVNKubernetes: true,
		netopv1.NetworkTypeCalico:        true,
		netopv1.NetworkTypeKuryr:         true,
	}

	// ValidNetworkTypeValues is a slice filled with the valid network types as
	// strings.
	ValidNetworkTypeValues = func() []string {
		validValues := make([]string, len(ValidNetworkTypes))
		i := 0
		for t := range ValidNetworkTypes {
			validValues[i] = string(t)
			i++
		}
		sort.Strings(validValues)
		return validValues
	}()
)

Functions

func ClusterName

func ClusterName(v string) error

ClusterName checks if the given string is a valid name for a cluster and returns an error if not.

func DoCIDRsOverlap added in v0.7.0

func DoCIDRsOverlap(acidr, bcidr *net.IPNet) bool

DoCIDRsOverlap returns true if one of the CIDRs is a subset of the other.

func DomainName

func DomainName(v string) error

DomainName checks if the given string is a valid domain name and returns an error if not.

func ImagePullSecret added in v0.7.0

func ImagePullSecret(secret string) error

ImagePullSecret checks if the given string is a valid image pull secret and returns an error if not.

func SSHPublicKey added in v0.4.0

func SSHPublicKey(v string) error

SSHPublicKey checks if the given string is a valid SSH public key and returns an error if not.

func SubnetCIDR

func SubnetCIDR(cidr *net.IPNet) error

SubnetCIDR checks if the given IP net is a valid CIDR for a master nodes or worker nodes subnet and returns an error if not.

func URI added in v0.7.0

func URI(uri string) error

URI validates if the URI is a valid absolute URI.

Types

This section is empty.

Jump to

Keyboard shortcuts

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