openshift

package
v0.0.0-...-f35731a Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2017 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PackagedTemplates = map[string]string{}

PackagedTemplates map of locally stored templates

View Source
var ServiceTemplates = map[string]string{}

ServiceTemplates map of locally stored templates without job templates

Functions

func BuildDefaultConfig

func BuildDefaultConfig(host, token string) clientcmd.ClientConfig

BuildDefaultConfig setups a kube config with the given host and token

func MarkServices

func MarkServices(ts []*deploy.Template, services []kapi.Service)

MarkServices mark services that are deployed to true

func NewTemplateLoaderDecoder

func NewTemplateLoaderDecoder(templateDir string) *templateLoaderDecoder

NewTemplateLoaderDecoder creates a template loader that loads templates from the supplied directory Todo: Don't return an unexported type

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an external type that wraps both kubernetes and oc

func ClientFromConfig

func ClientFromConfig(conf clientcmd.ClientConfig) (Client, error)

ClientFromConfig returns a client that wraps both kubernetes and openshift operations

func (Client) BuildConfigLogURL

func (c Client) BuildConfigLogURL(ns, bc string) string

BuildConfigLogURL returns the URL that can be polled for the build log of the specified dc in the specified namespace

func (Client) BuildURL

func (c Client) BuildURL(ns, bc, id string) string

BuildURL returns the URL that can be polled for the build log of the specified build id for the specified dc in the specified namespace

func (Client) CreateBuildConfigInNamespace

func (c Client) CreateBuildConfigInNamespace(ns string, b *bc.BuildConfig) (*bc.BuildConfig, error)

CreateBuildConfigInNamespace creates the supplied build config in the supplied namespace and returns the buildconfig, or any errors that occurred

func (Client) CreateConfigMap

func (c Client) CreateConfigMap(ns string, cm *api.ConfigMap) (*api.ConfigMap, error)

CreateConfigMap creates a ConfigMap in the given namespace

func (Client) CreateDeployConfigInNamespace

func (c Client) CreateDeployConfigInNamespace(ns string, d *dc.DeploymentConfig) (*dc.DeploymentConfig, error)

CreateDeployConfigInNamespace creates the supplied deploy config in the supplied namespace and returns the deployconfig, or any errors that occurred

func (Client) CreateImageStream

func (c Client) CreateImageStream(ns string, i *ioapi.ImageStream) (*ioapi.ImageStream, error)

CreateImageStream creates the specified imagestream in the specified namespace

func (Client) CreateJobToWatch

func (c Client) CreateJobToWatch(j *batch.Job, ns string) (watch.Interface, error)

CreateJobToWatch creates a job and returns a watch on that Job

func (Client) CreatePersistentVolumeClaim

func (c Client) CreatePersistentVolumeClaim(namespace string, claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)

CreatePersistentVolumeClaim uses the k8s api to setup the given claim

func (Client) CreatePod

func (c Client) CreatePod(ns string, p *api.Pod) (*api.Pod, error)

CreatePod creates a pod object and returns it

func (Client) CreateRouteInNamespace

func (c Client) CreateRouteInNamespace(ns string, r *roapi.Route) (*roapi.Route, error)

CreateRouteInNamespace creates the specified route in the specified namespace

func (Client) CreateSecretInNamespace

func (c Client) CreateSecretInNamespace(ns string, s *api.Secret) (*api.Secret, error)

CreateSecretInNamespace creates the specified secret in the specified namespace

func (Client) CreateServiceInNamespace

func (c Client) CreateServiceInNamespace(ns string, svc *api.Service) (*api.Service, error)

CreateServiceInNamespace creates the specified service in the specified namespace

func (Client) DeployLogURL

func (c Client) DeployLogURL(ns, dc string) string

DeployLogURL returns the URL that can be polled for the deploy log of the specified dc in the specified namespace

func (Client) FindBuildConfigByLabel

func (c Client) FindBuildConfigByLabel(ns string, searchLabels map[string]string) (*bc.BuildConfig, error)

FindBuildConfigByLabel searches for a build config by a label selector

func (Client) FindConfigMapByName

func (c Client) FindConfigMapByName(ns, name string) (*api.ConfigMap, error)

FindConfigMapByName returns a config map for name

func (Client) FindDeploymentConfigsByLabel

func (c Client) FindDeploymentConfigsByLabel(ns string, searchLabels map[string]string) ([]dc.DeploymentConfig, error)

FindDeploymentConfigsByLabel searches for a deployment config by a label selector

func (Client) FindJobByName

func (c Client) FindJobByName(ns, name string) (*batch.Job, error)

FindJobByName return nil if not found or the Job object

func (Client) FindRouteByName

func (c Client) FindRouteByName(ns, name string) (*roapi.Route, error)

FindRouteByName returns a route by name from the namespace

func (Client) FindServiceByLabel

func (c Client) FindServiceByLabel(ns string, searchLabels map[string]string) ([]api.Service, error)

FindServiceByLabel finds services deployed to the namespace based on searchLabels

func (Client) GetDeployLogs

func (c Client) GetDeployLogs(ns, deployName string) (string, error)

GetDeployLogs returns the logs for the supplied deployName in the supplied namespace

func (Client) GetDeploymentConfigByName

func (c Client) GetDeploymentConfigByName(ns, deploymentName string) (*dc.DeploymentConfig, error)

GetDeploymentConfigByName returns the DeploymentConfig for the name passed

func (Client) InstantiateBuild

func (c Client) InstantiateBuild(ns, buildName string) (*bc.Build, error)

InstantiateBuild will kick off a build in OSCP

func (Client) ListBuildConfigs

func (c Client) ListBuildConfigs(ns string) (*bcv1.BuildConfigList, error)

ListBuildConfigs will return all build configs for the given namespace

func (Client) PodLogs

func (c Client) PodLogs(ns, name string, lines int64) ([]byte, error)

func (Client) UpdateBuildConfigInNamespace

func (c Client) UpdateBuildConfigInNamespace(ns string, b *bc.BuildConfig) (*bc.BuildConfig, error)

UpdateBuildConfigInNamespace updates the supplied build config in the supplied namespace and returns the buildconfig, or any errors that occurred

func (Client) UpdateConfigMap

func (c Client) UpdateConfigMap(ns string, cm *api.ConfigMap) (*api.ConfigMap, error)

UpdateConfigMap updates the ConfigMap in the given namespace

func (Client) UpdateDeployConfigInNamespace

func (c Client) UpdateDeployConfigInNamespace(ns string, d *dc.DeploymentConfig) (*dc.DeploymentConfig, error)

UpdateDeployConfigInNamespace updates the supplied deploy config in the supplied namespace and returns the deployconfig and any errors that occurred

func (Client) UpdateRouteInNamespace

func (c Client) UpdateRouteInNamespace(ns string, r *roapi.Route) (*roapi.Route, error)

UpdateRouteInNamespace updates the supplied route in the supplied namespace and returns the route and any error

type ClientFactory

type ClientFactory struct{}

ClientFactory will create and return an openshift client

func (ClientFactory) DefaultDeployClient

func (ClientFactory) DefaultDeployClient(host, token string) (deploy.Client, error)

DefaultDeployClient will return a sane default client configured for the given host and token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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