Documentation ¶
Index ¶
- func AddNameserversToInstance(sshRunner *ssh.Runner, nameservers []NameServer) error
- func CheckCRCLocalDNSReachableFromHost(bundle *bundle.CrcBundleInfo, expectedIP string) error
- func CreateResolvFile(values ResolvFileValues) (string, error)
- func CreateResolvFileOnInstance(sshRunner *ssh.Runner, resolvFileValues ResolvFileValues) error
- func HasGivenNameserversConfigured(sshRunner *ssh.Runner, nameserver NameServer) (bool, error)
- func SuccessfullyAppliedMode(_ string, _ interface{}) string
- func URIStringForDisplay(uri string) (string, error)
- func ValidateMode(val interface{}) (bool, string)
- func ValidateProxyURL(proxyURL string) error
- type Mode
- type NameServer
- type ProxyConfig
- type ResolvFileValues
- type SearchDomain
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNameserversToInstance ¶
func AddNameserversToInstance(sshRunner *ssh.Runner, nameservers []NameServer) error
AddNameserversToInstance will add additional nameservers to the end of the /etc/resolv.conf file inside the instance.
func CheckCRCLocalDNSReachableFromHost ¶
func CheckCRCLocalDNSReachableFromHost(bundle *bundle.CrcBundleInfo, expectedIP string) error
func CreateResolvFile ¶
func CreateResolvFile(values ResolvFileValues) (string, error)
func CreateResolvFileOnInstance ¶
func CreateResolvFileOnInstance(sshRunner *ssh.Runner, resolvFileValues ResolvFileValues) error
func HasGivenNameserversConfigured ¶
func HasGivenNameserversConfigured(sshRunner *ssh.Runner, nameserver NameServer) (bool, error)
HasGivenNameserversConfigured returns true if the instance uses a provided nameserver.
func SuccessfullyAppliedMode ¶ added in v1.20.0
func URIStringForDisplay ¶ added in v1.14.0
func ValidateMode ¶ added in v1.20.0
func ValidateProxyURL ¶
ValidateProxyURL validates that the specified proxyURL is valid
Types ¶
type NameServer ¶
type NameServer struct {
IPAddress string
}
type ProxyConfig ¶
type ProxyConfig struct { HTTPProxy string HTTPSProxy string ProxyCACert string // contains filtered or unexported fields }
ProxyConfig keeps the proxy configuration for the current environment
var (
DefaultProxy ProxyConfig
)
func NewProxyConfig ¶
func NewProxyConfig() (*ProxyConfig, error)
NewProxyConfig creates a proxy configuration with the specified parameters. If an empty string is passed the corresponding environment variable is checked.
func NewProxyDefaults ¶
func NewProxyDefaults(httpProxy, httpsProxy, noProxy, proxyCACert string) (*ProxyConfig, error)
func (*ProxyConfig) AddNoProxy ¶
func (p *ProxyConfig) AddNoProxy(host ...string)
AddNoProxy appends the specified host to the list of no proxied hosts.
func (*ProxyConfig) ApplyToEnvironment ¶
func (p *ProxyConfig) ApplyToEnvironment()
Sets the current config as environment variables in the current process.
func (*ProxyConfig) GetNoProxyString ¶
func (p *ProxyConfig) GetNoProxyString() string
func (*ProxyConfig) HTTPProxyForDisplay ¶ added in v1.14.0
func (p *ProxyConfig) HTTPProxyForDisplay() string
HTTPProxy with hidden credentials
func (*ProxyConfig) HTTPSProxyForDisplay ¶ added in v1.14.0
func (p *ProxyConfig) HTTPSProxyForDisplay() string
HTTPSProxy with hidden credentials
func (*ProxyConfig) IsEnabled ¶
func (p *ProxyConfig) IsEnabled() bool
Enabled returns true if at least one proxy (HTTP or HTTPS) is configured. Returns false otherwise.
type ResolvFileValues ¶
type ResolvFileValues struct { SearchDomains []SearchDomain NameServers []NameServer }
func GetResolvValuesFromHost ¶
func GetResolvValuesFromHost() (*ResolvFileValues, error)
func GetResolvValuesFromInstance ¶
func GetResolvValuesFromInstance(sshRunner *ssh.Runner) (*ResolvFileValues, error)
type SearchDomain ¶
type SearchDomain struct {
Domain string
}