clients

package
Version: v0.0.0-...-793517a Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 29 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ChangePodNetworkAnnotation - Annotation used for changing a pod
	// network, used to join networks together.
	ChangePodNetworkAnnotation = "pod.network.openshift.io/multitenant.change-network"
)

Variables

View Source
var (
	// ErrCredentialsNotFound - Will be the return if extracted credentials can not be found
	ErrCredentialsNotFound = errors.New("credentials not found")
)

Functions

func Etcd

func Etcd() (etcd.Client, error)

Etcd - Create a new etcd client if needed, returns reference

func GetEtcdVersion

func GetEtcdVersion(ec EtcdConfig) (string, string, error)

GetEtcdVersion - Connects to ETCD cluster and retrieves server/version info

func GetSecretData

func GetSecretData(secretName, namespace string) (map[string][]byte, error)

GetSecretData - Returns the data inside of a given secret.

func InitEtcdConfig

func InitEtcdConfig(config EtcdConfig)

InitEtcdConfig - Initialize the configuration for etcd.

Types

type CRD

type CRD struct {
	clientset.Interface
}

CRD - Client to interact with automationbroker crd API

func CRDClient

func CRDClient() (*CRD, error)

CRDClient - Create a new kubernetes client if needed, returns reference

type EtcdConfig

type EtcdConfig struct {
	EtcdHost       string `yaml:"etcd_host"`
	EtcdCaFile     string `yaml:"etcd_ca_file"`
	EtcdClientCert string `yaml:"etcd_client_cert"`
	EtcdClientKey  string `yaml:"etcd_client_key"`
	EtcdPort       int    `yaml:"etcd_port"`
}

EtcdConfig - Etcd configuration

type KubernetesClient

type KubernetesClient struct {
	Client       clientset.Interface
	ClientConfig *rest.Config
}

KubernetesClient - Client to interact with Kubernetes API

func Kubernetes

func Kubernetes() (*KubernetesClient, error)

Kubernetes - Create a new kubernetes client if needed, returns reference

func (KubernetesClient) CreateRoleBinding

func (k KubernetesClient) CreateRoleBinding(
	roleBindingName string,
	rbacSubjects []rbac.Subject,
	namespace string,
	targetNamespace string,
	roleRef rbac.RoleRef) error

CreateRoleBinding - Create a Role Binding

func (KubernetesClient) CreateServiceAccount

func (k KubernetesClient) CreateServiceAccount(podName string, namespace string) error

CreateServiceAccount - Create a service account

func (KubernetesClient) DeleteExtractedCredentialSecret

func (k KubernetesClient) DeleteExtractedCredentialSecret(instanceID, ns string) error

DeleteExtractedCredentialSecret - delete extracted credentials secret

func (KubernetesClient) DeleteRoleBinding

func (k KubernetesClient) DeleteRoleBinding(roleBindingName string, namespace string) error

DeleteRoleBinding - Delete a Role Binding

func (KubernetesClient) GetExtractedCredentialSecretData

func (k KubernetesClient) GetExtractedCredentialSecretData(instanceID, ns string) (map[string]interface{}, error)

GetExtractedCredentialSecretData - Get extracted credentials secret data

func (KubernetesClient) GetPodStatus

func (k KubernetesClient) GetPodStatus(podName, namespace string) (*apiv1.PodStatus, error)

GetPodStatus - Returns the current status of a pod in a specified namespace

func (KubernetesClient) GetSecretData

func (k KubernetesClient) GetSecretData(secretName, namespace string) (map[string][]byte, error)

GetSecretData - Returns the data inside of a given secret

func (KubernetesClient) SaveExtractedCredentialSecret

func (k KubernetesClient) SaveExtractedCredentialSecret(instanceID, ns string,
	extCreds map[string]interface{}, labels map[string]string) error

SaveExtractedCredentialSecret - Save the extCreds as a secret

func (KubernetesClient) UpdateExtractedCredentialSecret

func (k KubernetesClient) UpdateExtractedCredentialSecret(instanceID, ns string,
	extCreds map[string]interface{}, labels map[string]string) error

UpdateExtractedCredentialSecret - Updates the extCreds in a secret

type OpenshiftClient

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

OpenshiftClient - Client to interact with openshift api

func Openshift

func Openshift() (*OpenshiftClient, error)

Openshift - Create a new openshift client if needed, returns reference

func (OpenshiftClient) GetClusterNetworkPlugin

func (o OpenshiftClient) GetClusterNetworkPlugin() (string, error)

GetClusterNetworkPlugin - Get cluster network

func (OpenshiftClient) GetNetNamespace

func (o OpenshiftClient) GetNetNamespace(nsName string) (*networkoapi.NetNamespace, error)

GetNetNamespace - Get Net Namespace.

func (OpenshiftClient) Image

Image - Returns a V1Image Interface

func (OpenshiftClient) IsolateNamespacesNetworks

func (o OpenshiftClient) IsolateNamespacesNetworks(netns *networkoapi.NetNamespace,
	targetNS string,
) (*networkoapi.NetNamespace, error)

IsolateNamespacesNetworks - Will take the net namespace to be added to a network, and the namespace ID of the network that is being added to..

func (OpenshiftClient) JoinNamespacesNetworks

func (o OpenshiftClient) JoinNamespacesNetworks(netns *networkoapi.NetNamespace,
	targetNS string,
) (*networkoapi.NetNamespace, error)

JoinNamespacesNetworks - Will take the net namespace to be added to a network, and the namespace ID of the network that is being added to.

func (OpenshiftClient) ListRegistryImages

func (o OpenshiftClient) ListRegistryImages() (*v1.ImageList, error)

ListRegistryImages - List images in internal OpenShift registry

func (OpenshiftClient) Route

Route - Returns a V1Route Interface

func (OpenshiftClient) SubjectRulesReview

func (o OpenshiftClient) SubjectRulesReview(user string, groups []string,
	scopes []string, namespace string) (result []authoapi.PolicyRule, err error)

SubjectRulesReview - create and run a OpenShift Subject Rules Review

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL