Documentation
¶
Overview ¶
Package validate contains validation utilities for installer types.
Index ¶
- Variables
- func CABundle(v string) error
- func ClusterName(v string) error
- func ClusterName1035(v string) error
- func ClusterNameMaxLength(v string, maxlen int) error
- func DoCIDRsOverlap(acidr, bcidr *net.IPNet) bool
- func DomainName(v string, acceptTrailingDot bool) error
- func GCPClusterName(v string) error
- func Host(v string) error
- func IP(ip string) error
- func ImagePullSecret(secret string) error
- func MAC(addr string) error
- func NoProxyDomainName(v string) error
- func OnPremClusterName(v string) error
- func SSHPublicKey(v string) error
- func ServiceSubnetCIDR(cidr *net.IPNet) error
- func SubnetCIDR(cidr *net.IPNet) error
- func URI(uri string) error
- func URIWithProtocol(uri string, protocol string) error
- func UUID(val string) error
Constants ¶
This section is empty.
Variables ¶
var ( // DockerBridgeSubnet is the default v4 subnet for Docker. DockerBridgeSubnet = cidrToIPNet("172.17.0.0/16") // OVNIPv4JoinSubnet is the default v4 subnet for join switches. OVNIPv4JoinSubnet = cidrToIPNet("100.64.0.0/16") // OVNIPv4TransitSubnet is the default v4 subnet for transit switches. OVNIPv4TransitSubnet = cidrToIPNet("100.88.0.0/16") // OVNIPv4MasqueradeSubnet is the default v4 masquerade subnet. // In OCP <= 4.17, the default is 169.254.169.0/29. OVNIPv4MasqueradeSubnet = cidrToIPNet("169.254.0.0/17") // OVNIPv6JoinSubnet is the default v6 subnet for join switches. OVNIPv6JoinSubnet = cidrToIPNet("fd98::/64") // OVNIPv6TransitSubnet is the default v6 subnet for transit switches. OVNIPv6TransitSubnet = cidrToIPNet("fd97::/64") // OVNIPv6MasqueradeSubnet is the default v6 masquerade subnet. // In OCP <= 4.17, the default is fd69::/125. OVNIPv6MasqueradeSubnet = cidrToIPNet("fd69::/112") )
Functions ¶
func CABundle ¶ added in v0.4.15
CABundle checks if the given string contains valid certificate(s) and returns an error if not.
func ClusterName ¶
ClusterName checks if the given string is a valid name for a cluster and returns an error if not. The max length of the DNS label is `DNS1123LabelMaxLength + 9` because the public DNS zones have records `api.clustername`, `*.apps.clustername`, and *.apps is rendered as the nine-character \052.apps in DNS records.
func ClusterName1035 ¶ added in v0.4.15
ClusterName1035 checks the provided cluster name matches RFC1035 naming requirements. Some platform resource names must comply with RFC1035 "[a-z]([-a-z0-9]*[a-z0-9])?". They are based on the InfraID, which is a truncated version of the cluster name where all non- alphanumeric characters "[^A-Za-z0-9-]" have been replaced with dashes "-". As a result, if we first verify the name starts with a lower-case letter "^[a-z]" then we can rely on the ClusterName function to confirm compliance with the rest. The resulting name will therefore match RFC1035 with the exception of possible periods ".", which will be translated into dashes "-" in the InfraID before being used to create cloud resources.
func ClusterNameMaxLength ¶ added in v0.4.15
ClusterNameMaxLength validates if the string provided length is greater than maxlen argument.
func DoCIDRsOverlap ¶ added in v0.4.15
DoCIDRsOverlap returns true if one of the CIDRs is a subset of the other.
func DomainName ¶
DomainName checks if the given string is a valid domain name and returns an error if not.
func GCPClusterName ¶ added in v0.4.15
GCPClusterName checks if the provided cluster name has words similar to the word 'google' since resources with that name are not allowed in GCP.
func ImagePullSecret ¶ added in v0.4.15
ImagePullSecret checks if the given string is a valid image pull secret and returns an error if not.
func NoProxyDomainName ¶ added in v0.4.15
NoProxyDomainName checks if the given string is a valid proxy noProxy domain name and returns an error if not. Example valid noProxy domains are ".foo.com", "bar.com", "bar.com." but not "*.foo.com".
func OnPremClusterName ¶ added in v0.4.15
OnPremClusterName verifies if the cluster name contains a '.' and returns an error if it does.
func SSHPublicKey ¶ added in v0.4.0
SSHPublicKey checks if the given string is a valid SSH public key and returns an error if not.
func ServiceSubnetCIDR ¶ added in v0.4.15
ServiceSubnetCIDR checks if the given IP net is a valid CIDR for the Kubernetes service network
func SubnetCIDR ¶
SubnetCIDR checks if the given IP net is a valid CIDR.
func URIWithProtocol ¶ added in v0.4.15
URIWithProtocol validates that the URI specifies a certain protocol scheme (e.g. "https")
Types ¶
This section is empty.