Documentation
¶
Overview ¶
Copyright © 2021 MicroShift Contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 MicroShift Contributors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 MicroShift Contributors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func AddToNoProxyEnv(additionalEntries ...string) error
- func ContainIPANetwork(ip tcpnet.IP, networks []string) bool
- func ConvertYAMLOrJSONToUnstructured(reader io.Reader) (*unstructured.Unstructured, error)
- func CreateTempDir(path string) (string, error)
- func CreateTempFile(path string) (*os.File, error)
- func Default(s string, defaultS string) string
- func EnsureKeyPair(pubKeyPath, privKeyPath string) error
- func FindDefaultRouteIface(ipFamily int) (iface *tcpnet.Interface, err error)
- func FindDefaultRouteMTU(ipFamily int) (mtu int, err error)
- func FindDefaultRouteMinMTU() (mtu int, err error)
- func GenKeys(pubPath, keyPath string) error
- func GetHostIP(nodeIP string) (string, error)
- func GetHostIPv6(ipHint string) (string, error)
- func GetOSVersion() (string, error)
- func GetSNIsFromCert(certPath string, extraNames []string) ([]string, error)
- func HasDefaultRoute() (bool, error)
- func HealthCheckServer(ctx context.Context, path, port string) (start func() error, shutdown func() error)
- func IsBootc() bool
- func IsCertAllowed(advertiseAddress string, clusterNetwork []string, serviceNetwork []string, ...) (bool, error)
- func IsOSTree() (bool, error)
- func IsWildcardDNS(val string) bool
- func KubeConfigWithClientCerts(path string, clusterURL string, clusterTrustBundle []byte, ...) error
- func MakeDir(path string) error
- func Must(err error)
- func PathExists(path string) (bool, error)
- func PathExistsAndIsNotEmpty(path string, ignores ...string) (bool, error)
- func PathExistsFS(fsys fs.StatFS, path string) (bool, error)
- func PublicKeyToPem(key *rsa.PublicKey) ([]byte, error)
- func RetryGet(ctx context.Context, url, additionalCAPath string) int
- func RetryInsecureGet(ctx context.Context, url string) int
- func RetryTCPConnection(ctx context.Context, host string, port string) bool
- func VerifyAllowedSNI(advertiseAddress string, clusterNetwork []string, serviceNetwork []string, ...) bool
- type AllErrGroup
- type LogFilePath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToNoProxyEnv ¶
func ContainIPANetwork ¶
ContainIPANetwork - will check if given IP address contained within list of networks
func ConvertYAMLOrJSONToUnstructured ¶
func ConvertYAMLOrJSONToUnstructured(reader io.Reader) (*unstructured.Unstructured, error)
ConvertYAMLOrJSONToUnstructured converts a YAML or JSON stream to an unstructured object. It returns an error if the stream cannot be decoded or the object cannot be converted to unstructured. The function is used to parse Kubernetes resources from files that are unknown at compile time.
func CreateTempDir ¶
CreateTempDir creates a temporary directory from given path and returns the pathname of the new directory.
func CreateTempFile ¶
CreateTempFile creates a temporary file from given path and returns resulting file
func EnsureKeyPair ¶
func FindDefaultRouteIface ¶
Find the Default route Interface based on ipv4 or ipv6 routes.
func FindDefaultRouteMTU ¶
func FindDefaultRouteMinMTU ¶
func GetHostIPv6 ¶
func GetOSVersion ¶
func GetSNIsFromCert ¶
GetSNIsFromCert - get list of unique SNIs from certificate
func HasDefaultRoute ¶
HasDefaultRoute returns whether the host has a default route for IPv4 or IPv6.
func HealthCheckServer ¶
func HealthCheckServer(ctx context.Context, path, port string) (start func() error, shutdown func() error)
StartHealthCheck starts a server for a simple health check endpoint Returns a start and shutdown handler.
Note: typically servers return a non-nil error, here we return nil if the server was naturally shutdown.
func IsCertAllowed ¶
func KubeConfigWithClientCerts ¶
func KubeConfigWithClientCerts( path string, clusterURL string, clusterTrustBundle []byte, clientCertPEM []byte, clientKeyPEM []byte, ) error
KubeConfigWithClientCerts creates a kubeconfig authenticating with client cert/key at a location provided by `path`
func PathExists ¶
func PathExistsAndIsNotEmpty ¶
func PublicKeyToPem ¶
PublicKeyToPem converts an rsa.PublicKey object to pem string
func RetryTCPConnection ¶
Types ¶
type AllErrGroup ¶
type AllErrGroup struct {
// contains filtered or unexported fields
}
AllErrGroup is a helper to wait for all goroutines and get all errors that occurred. It's based on sync.WaitGroup (which doesn't capture any errors) and errgroup.Group (which only captures the first error).
func (*AllErrGroup) Go ¶
func (g *AllErrGroup) Go(f func() error)
func (*AllErrGroup) Wait ¶
func (g *AllErrGroup) Wait() error
type LogFilePath ¶
type LogFilePath string
func (LogFilePath) Remove ¶
func (l LogFilePath) Remove() error
Remove Will remove the existing file if it exists.
func (LogFilePath) Write ¶
func (l LogFilePath) Write(data []byte) error
Write writes data to the desired filename, calling multiple times will overwrite the file with the most recent data.