openshift

package
v0.0.0-...-221a34a Latest Latest
Warning

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

Go to latest
Published: May 10, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldKind                     = "kind"
	FieldAPIVersion               = "apiVersion"
	FieldObjects                  = "objects"
	FieldItems                    = "items"
	FieldMetadata                 = "metadata"
	FieldLabels                   = "labels"
	FieldVersion                  = "version"
	FieldNamespace                = "namespace"
	FieldName                     = "name"
	FieldResourceVersion          = "resourceVersion"
	ValKindTemplate               = "Template"
	ValKindProjectRequest         = "ProjectRequest"
	ValKindPersistenceVolumeClaim = "PersistentVolumeClaim"
	ValKindServiceAccount         = "ServiceAccount"
	ValKindList                   = "List"
)

Variables

This section is empty.

Functions

func Apply

func Apply(source string, opts ApplyOptions) error

Apply a given template structure to a target API

func GetKind

func GetKind(obj map[interface{}]interface{}) string

func GetLabelVersion

func GetLabelVersion(obj map[interface{}]interface{}) string

func GetName

func GetName(obj map[interface{}]interface{}) string

func GetNamespace

func GetNamespace(obj map[interface{}]interface{}) string

func InitTenant

func InitTenant(config Config, callback Callback, username, usertoken string, templateVars map[string]string) error

InitTenant initializes a new tenant in openshift Creates the new x-test|stage|run and x-jenkins|che namespaces and install the required services/routes/deployment configurations to run e.g. Jenkins and Che

func ParseObjects

func ParseObjects(source string, namespace string) ([]map[interface{}]interface{}, error)

ParseObjects return a string yaml and return a array of the objects/items from a Template/List kind

func Process

func Process(source string, variables map[string]string) (string, error)

Process takes a K8/Openshift Template as input and resolves the variable expresions

func WhoAmI

func WhoAmI(config Config) (string, error)

WhoAmI checks with OSO who owns the current token. returns the username

Types

type ApplyOptions

type ApplyOptions struct {
	Config
	Namespace string
	Callback  Callback
}

ApplyOptions contains options for connecting to the target API

func (*ApplyOptions) WithNamespace

func (a *ApplyOptions) WithNamespace(namespace string) ApplyOptions

type ByKind

type ByKind []map[interface{}]interface{}

ByKind represents a list of Openshift objects sortable by Kind

func (ByKind) Len

func (a ByKind) Len() int

func (ByKind) Less

func (a ByKind) Less(i, j int) bool

func (ByKind) Swap

func (a ByKind) Swap(i, j int)

type Callback

type Callback func(statusCode int, method string, request, response map[interface{}]interface{}) (string, map[interface{}]interface{})

Callback is called after initial action

type Config

type Config struct {
	MasterURL  string
	MasterUser string
	Token      string
}

func (Config) WithToken

func (c Config) WithToken(token string) Config

Jump to

Keyboard shortcuts

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