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 Default(s string, defaultS string) string
- func EnsureKeyPair(pubKeyPath, privKeyPath string) error
- func GenKeys(pubPath, keyPath string) error
- func GetHostIP(nodeIP string) (string, error)
- func GetHostIPv6(ipHint string) (string, error)
- func GetSNIsFromCert(certPath string, extraNames []string) ([]string, error)
- func HealthCheckServer(ctx context.Context, path, port string) (start func() error, shutdown func() error)
- func IsCertAllowed(advertiseAddress string, clusterNetwork []string, serviceNetwork []string, ...) (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 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 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 EnsureKeyPair ¶
func GetHostIPv6 ¶
func GetSNIsFromCert ¶
GetSNIsFromCert - get list of unique SNIs from certificate
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 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.