utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

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 NAME HERE <EMAIL ADDRESS>

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 NAME HERE <EMAIL ADDRESS>

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 NAME HERE <EMAIL ADDRESS>

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToFile

func BytesToFile(path, name string, data []byte) error

func CreateBasic

func CreateBasic(serverURL, userName, clusterName string, caCert []byte) *clientcmdapi.Config

CreateBasic creates a basic, general KubeConfig object that then can be extended

func CreateWithCerts

func CreateWithCerts(serverURL, userName, clusterName string, caCert []byte, clientKey []byte, clientCert []byte) *clientcmdapi.Config

CreateWithCerts creates a KubeConfig object with access to the API server with client certificates

func FileToBytes

func FileToBytes(path, name string) ([]byte, error)

func FlagsIP

func FlagsIP(ip string) []net.IP

FlagsIP Receive master external IP from command flags

func GenExamples

func GenExamples(path string)

func HomeDir

func HomeDir() string

func InternetIP

func InternetIP() (net.IP, error)

internetIP Current host Internet IP.

func IsIP

func IsIP(s string) bool

func MapToString

func MapToString(labels map[string]string) string

MapToString labels to string

func NewCRDsClient

func NewCRDsClient(c *rest.Config) (*clientset.Clientset, error)

NewCRDsClient clientset ClientSet

func NewClientSet

func NewClientSet(c *rest.Config) (*kubernetes.Clientset, error)

NewClientSet Kubernetes ClientSet

func PathForCert

func PathForCert(pkiPath, name string) string

func PathForKey

func PathForKey(pkiPath, name string) string

returns the paths for the certificate and key given the path and basename.

func PathIsExist

func PathIsExist(path string) bool

func RestConfig

func RestConfig(kubeconfigPath string) (*rest.Config, error)

RestConfig Kubernetes kubeconfig

func StaticYamlToJsonByte

func StaticYamlToJsonByte(staticYaml string) []byte

func StringToNetIP

func StringToNetIP(ip string) net.IP

func WriteKubeConfigFromSpec

func WriteKubeConfigFromSpec(serverURL, userName, clusterName, kubeconfigPath, kubeconfigName string, caCert []byte, clientKey []byte, clientCert []byte) error

writeKubeConfigFromSpec creates a kubeconfig object from a kubeConfigSpec and writes it to the given writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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