utils

package
v0.0.0-...-f8ed139 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = "0.0.1"

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error)

func CheckRequiredFlags

func CheckRequiredFlags(c *cli.Context, flags []string)

CheckRequiredFlags checks for required flags, and show usage if requirements not met

func FileExists

func FileExists(name string) bool

func GetMD5Hash

func GetMD5Hash(text string) string

func InitializeConfig

func InitializeConfig(c *cli.Context) error

func Keys

func Keys(m map[string]string) []string

Keys returns the keys in a map[string]string

func NormalizeName

func NormalizeName(name string) (string, error)

NormalizeName normalizes a kubeware name to fit k8s restrictions for label values

func Unzip

func Unzip(src, dest string) error

func Values

func Values(m map[string]string) []string

Values returns the values in a map[string]string

Types

type Cluster

type Cluster struct {
	Server                string `yaml:"server,omitempty"`
	APIVersion            string `yaml:"apiVersion,omitempty"`
	InsecureSkipTLSVerify bool   `yaml:"insecure-skip-tls-verify,omitempty"`
	CertificateAuthority  string `yaml:"certificate-authority,omitempty"`
}

type ClusterWrap

type ClusterWrap struct {
	Cluster Cluster `yaml:"cluster,omitempty"`
	Name    string  `yaml:"name,omitempty"`
}

type Config

type Config struct {
	Connection Connection
	Path       string
}

Config for kdeploy

func GetConfig

func GetConfig() (*Config, error)

GetConfig returns cached config

func PreReadConfig

func PreReadConfig() *Config

PreReadConfig reads configuration before full arguments

func ReadConfig

func ReadConfig() (*Config, error)

func ReadConfigFrom

func ReadConfigFrom(path string) (*Config, error)

type Connection

type Connection struct {
	APIEndpoint string
	CACert      string
	Cert        string
	Key         string
	Insecure    bool
}

Connection configuration

type Context

type Context struct {
	Cluster   string `yaml:"cluster"`
	User      string `yaml:"user"`
	Namespace string `yaml:"namespace,omitempty"`
}

Context is a tuple of references to a cluster (how do I communicate with a kubernetes cluster), a user (how do I identify myself), and a namespace (what subset of resources do I want to work with)

type ContextWrap

type ContextWrap struct {
	Context Context `yaml:"context,omitempty"`
	Name    string  `yaml:"name,omitempty"`
}

type KubeConfig

type KubeConfig struct {
	Kind           string        `yaml:"kind,omitempty"`
	APIVersion     string        `yaml:"apiVersion,omitempty"`
	Clusters       []ClusterWrap `yaml:"clusters,omitempty"`
	Users          []UserWrap    `yaml:"users,omitempty"`
	Contexts       []ContextWrap `yaml:"contexts,omitempty"`
	CurrentContext string        `yaml:"current-context,omitempty"`
}

KubeConfig holds the information needed to build connect to remote kubernetes clusters as a given user

type User

type User struct {
	ClientCertificate string `yaml:"client-certificate,omitempty"`
	ClientKey         string `yaml:"client-key,omitempty"`
}

User contains information that describes identity information. This is use to tell the kubernetes cluster who you are.

type UserWrap

type UserWrap struct {
	User User   `yaml:"user,omitempty"`
	Name string `yaml:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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