Documentation ¶
Index ¶
- Constants
- func BuildParameters(params interface{}) *runtime.RawExtension
- func BuildParametersFrom(secrets map[string]string) []v1beta1.ParametersFromSource
- func GetBindingStatusCondition(status v1beta1.ServiceBindingStatus) v1beta1.ServiceBindingCondition
- type Broker
- type Class
- type FilterOptions
- type Plan
- type RegisterOptions
- type RetrievePlanOptions
- type SDK
- func (sdk *SDK) Bind(namespace, bindingName, externalID, instanceName, secretName string, ...) (*v1beta1.ServiceBinding, error)
- func (sdk *SDK) BindingParentHierarchy(binding *v1beta1.ServiceBinding) (*v1beta1.ServiceInstance, *v1beta1.ClusterServiceClass, ...)
- func (sdk *SDK) Core() corev1.CoreV1Interface
- func (sdk *SDK) CreateClass(class *v1beta1.ClusterServiceClass) (*v1beta1.ClusterServiceClass, error)
- func (sdk *SDK) DeleteBinding(ns, bindingName string) error
- func (sdk *SDK) DeleteBindings(bindings []types.NamespacedName) ([]types.NamespacedName, error)
- func (sdk *SDK) Deprovision(namespace, instanceName string) error
- func (sdk *SDK) Deregister(brokerName string) error
- func (sdk *SDK) InstanceHasStatus(instance *v1beta1.ServiceInstance, status v1beta1.ServiceInstanceConditionType) bool
- func (sdk *SDK) InstanceParentHierarchy(instance *v1beta1.ServiceInstance) (*v1beta1.ClusterServiceClass, *v1beta1.ClusterServicePlan, ...)
- func (sdk *SDK) InstanceToServiceClassAndPlan(instance *v1beta1.ServiceInstance) (*v1beta1.ClusterServiceClass, *v1beta1.ClusterServicePlan, error)
- func (sdk *SDK) IsBindingFailed(binding *v1beta1.ServiceBinding) bool
- func (sdk *SDK) IsBindingReady(binding *v1beta1.ServiceBinding) bool
- func (sdk *SDK) IsInstanceFailed(instance *v1beta1.ServiceInstance) bool
- func (sdk *SDK) IsInstanceReady(instance *v1beta1.ServiceInstance) bool
- func (sdk *SDK) Provision(namespace, instanceName, externalID, className, planName string, ...) (*v1beta1.ServiceInstance, error)
- func (sdk *SDK) Register(brokerName string, url string, opts *RegisterOptions) (*v1beta1.ClusterServiceBroker, error)
- func (sdk *SDK) RetrieveBinding(ns, name string) (*v1beta1.ServiceBinding, error)
- func (sdk *SDK) RetrieveBindings(ns string) (*v1beta1.ServiceBindingList, error)
- func (sdk *SDK) RetrieveBindingsByInstance(instance *v1beta1.ServiceInstance) ([]v1beta1.ServiceBinding, error)
- func (sdk *SDK) RetrieveBroker(name string) (*v1beta1.ClusterServiceBroker, error)
- func (sdk *SDK) RetrieveBrokerByClass(class *v1beta1.ClusterServiceClass) (*v1beta1.ClusterServiceBroker, error)
- func (sdk *SDK) RetrieveBrokers(opts ScopeOptions) ([]Broker, error)
- func (sdk *SDK) RetrieveClassByID(uuid string) (*v1beta1.ClusterServiceClass, error)
- func (sdk *SDK) RetrieveClassByName(name string) (*v1beta1.ClusterServiceClass, error)
- func (sdk *SDK) RetrieveClassByPlan(plan *v1beta1.ClusterServicePlan) (*v1beta1.ClusterServiceClass, error)
- func (sdk *SDK) RetrieveClasses(opts ScopeOptions) ([]Class, error)
- func (sdk *SDK) RetrieveInstance(ns, name string) (*v1beta1.ServiceInstance, error)
- func (sdk *SDK) RetrieveInstanceByBinding(b *v1beta1.ServiceBinding) (*v1beta1.ServiceInstance, error)
- func (sdk *SDK) RetrieveInstances(ns, classFilter, planFilter string) (*v1beta1.ServiceInstanceList, error)
- func (sdk *SDK) RetrieveInstancesByPlan(plan *v1beta1.ClusterServicePlan) ([]v1beta1.ServiceInstance, error)
- func (sdk *SDK) RetrievePlanByClassAndPlanNames(className, planName string) (*v1beta1.ClusterServicePlan, error)
- func (sdk *SDK) RetrievePlanByID(uuid string) (*v1beta1.ClusterServicePlan, error)
- func (sdk *SDK) RetrievePlanByName(name string) (*v1beta1.ClusterServicePlan, error)
- func (sdk *SDK) RetrievePlans(opts RetrievePlanOptions) ([]Plan, error)
- func (sdk *SDK) RetrieveSecretByBinding(binding *v1beta1.ServiceBinding) (*corev1.Secret, error)
- func (sdk *SDK) ServerVersion() (*version.Info, error)
- func (sdk *SDK) ServiceCatalog() v1beta1.ServicecatalogV1beta1Interface
- func (sdk *SDK) Sync(name string, retries int) error
- func (sdk *SDK) TouchInstance(ns, name string, retries int) error
- func (sdk *SDK) Unbind(ns, instanceName string) ([]types.NamespacedName, error)
- func (sdk *SDK) WaitForBinding(ns, name string, interval time.Duration, timeout *time.Duration) (binding *v1beta1.ServiceBinding, err error)
- func (sdk *SDK) WaitForInstance(ns, name string, interval time.Duration, timeout *time.Duration) (instance *v1beta1.ServiceInstance, err error)
- func (sdk *SDK) WaitForInstanceToNotExist(ns, name string, interval time.Duration, timeout *time.Duration) (instance *v1beta1.ServiceInstance, err error)
- type Scope
- type ScopeOptions
- type SvcatClient
Constants ¶
const ( // FieldExternalPlanName is the jsonpath to a plan's external name. FieldExternalPlanName = "spec.externalName" // FieldServiceClassRef is the jsonpath to a plan's associated class name. FieldServiceClassRef = "spec.clusterServiceClassRef.name" )
const ( // ClusterScope filters resources to those defined at the cluster-scope. ClusterScope = "cluster" // NamespaceScope filters resources to those defined within a namespace. NamespaceScope = "namespace" // AllScope combines all resources at both the cluster and namespace scopes. AllScope = "all" )
const (
// FieldExternalClassName is the jsonpath to a class's external name.
FieldExternalClassName = "spec.externalName"
)
const (
// FieldServicePlanRef is the jsonpath to an instance's plan name (uuid).
FieldServicePlanRef = "spec.clusterServicePlanRef.name"
)
Variables ¶
This section is empty.
Functions ¶
func BuildParameters ¶
func BuildParameters(params interface{}) *runtime.RawExtension
BuildParameters converts a map of variable assignments to a byte encoded json document, which is what the ServiceCatalog API consumes.
func BuildParametersFrom ¶
func BuildParametersFrom(secrets map[string]string) []v1beta1.ParametersFromSource
BuildParametersFrom converts a map of secrets names to secret keys to the type consumed by the ServiceCatalog API.
func GetBindingStatusCondition ¶
func GetBindingStatusCondition(status v1beta1.ServiceBindingStatus) v1beta1.ServiceBindingCondition
GetBindingStatusCondition returns the last condition on a binding status. When no conditions exist, an empty condition is returned.
Types ¶
type Broker ¶
type Broker interface { // GetName returns the broker's name. GetName() string // GetNamespace returns the broker's namespace, or "" if it's cluster-scoped. GetNamespace() string // GetURL returns the broker's URL. GetURL() string // GetStatus returns the broker's status. GetStatus() v1beta1.CommonServiceBrokerStatus }
Broker provides a unifying layer of cluster and namespace scoped broker resources.
type Class ¶
type Class interface { // GetName returns the class's name. GetName() string // GetNamespace returns the class's namespace, or "" if it's cluster-scoped. GetNamespace() string // GetExternalName returns the class's external name. GetExternalName() string // GetDescription returns the class description. GetDescription() string }
Class provides a unifying layer of cluster and namespace scoped class resources.
type FilterOptions ¶
type FilterOptions struct {
ClassID string
}
FilterOptions allows for optional filtering fields to be passed to `Retrieve` methods.
type Plan ¶
type Plan interface { // GetName returns the plan's name. GetName() string // GetNamespace returns the plan's namespace, or "" if it's cluster-scoped. GetNamespace() string // GetExternalName returns the plan's external name. GetExternalName() string // GetDescription returns the plan description. GetDescription() string // GetClassID returns the plan's class name. GetClassID() string }
Plan provides a unifying layer of cluster and namespace scoped plan resources.
type RegisterOptions ¶
type RegisterOptions struct { BasicSecret string BearerSecret string CAFile string ClassRestrictions []string Namespace string PlanRestrictions []string RelistBehavior v1beta1.ServiceBrokerRelistBehavior RelistDuration *metav1.Duration SkipTLS bool }
RegisterOptions allows for passing of optional fields to the broker Register method.
type RetrievePlanOptions ¶
RetrievePlanOptions allows to specify which plans will be retrieved
type SDK ¶
type SDK struct { K8sClient kubernetes.Interface ServiceCatalogClient clientset.Interface }
SDK wrapper around the generated Go client for the Kubernetes Service Catalog
func (*SDK) Bind ¶
func (sdk *SDK) Bind(namespace, bindingName, externalID, instanceName, secretName string, params interface{}, secrets map[string]string) (*v1beta1.ServiceBinding, error)
Bind an instance to a secret.
func (*SDK) BindingParentHierarchy ¶
func (sdk *SDK) BindingParentHierarchy(binding *v1beta1.ServiceBinding, ) (*v1beta1.ServiceInstance, *v1beta1.ClusterServiceClass, *v1beta1.ClusterServicePlan, *v1beta1.ClusterServiceBroker, error)
BindingParentHierarchy retrieves all ancestor resources of a binding.
func (*SDK) Core ¶
func (sdk *SDK) Core() corev1.CoreV1Interface
Core is the underlying generated Core API versioned interface It should be used instead of accessing the client directly.
func (*SDK) CreateClass ¶
func (sdk *SDK) CreateClass(class *v1beta1.ClusterServiceClass) (*v1beta1.ClusterServiceClass, error)
CreateClass returns new created class
func (*SDK) DeleteBinding ¶
DeleteBinding by name.
func (*SDK) DeleteBindings ¶
func (sdk *SDK) DeleteBindings(bindings []types.NamespacedName) ([]types.NamespacedName, error)
DeleteBindings deletes bindings by name.
func (*SDK) Deprovision ¶
Deprovision deletes an instance.
func (*SDK) Deregister ¶
Deregister deletes a broker
func (*SDK) InstanceHasStatus ¶
func (sdk *SDK) InstanceHasStatus(instance *v1beta1.ServiceInstance, status v1beta1.ServiceInstanceConditionType) bool
InstanceHasStatus returns if the instance is in the specified status.
func (*SDK) InstanceParentHierarchy ¶
func (sdk *SDK) InstanceParentHierarchy(instance *v1beta1.ServiceInstance, ) (*v1beta1.ClusterServiceClass, *v1beta1.ClusterServicePlan, *v1beta1.ClusterServiceBroker, error)
InstanceParentHierarchy retrieves all ancestor resources of an instance.
func (*SDK) InstanceToServiceClassAndPlan ¶
func (sdk *SDK) InstanceToServiceClassAndPlan(instance *v1beta1.ServiceInstance, ) (*v1beta1.ClusterServiceClass, *v1beta1.ClusterServicePlan, error)
InstanceToServiceClassAndPlan retrieves the parent class and plan for an instance.
func (*SDK) IsBindingFailed ¶
func (sdk *SDK) IsBindingFailed(binding *v1beta1.ServiceBinding) bool
IsBindingFailed returns true if the instance is in the Failed status.
func (*SDK) IsBindingReady ¶
func (sdk *SDK) IsBindingReady(binding *v1beta1.ServiceBinding) bool
IsBindingReady returns true if the instance is in the Ready status.
func (*SDK) IsInstanceFailed ¶
func (sdk *SDK) IsInstanceFailed(instance *v1beta1.ServiceInstance) bool
IsInstanceFailed returns if the instance is in the Failed status.
func (*SDK) IsInstanceReady ¶
func (sdk *SDK) IsInstanceReady(instance *v1beta1.ServiceInstance) bool
IsInstanceReady returns if the instance is in the Ready status.
func (*SDK) Provision ¶
func (sdk *SDK) Provision(namespace, instanceName, externalID, className, planName string, params interface{}, secrets map[string]string) (*v1beta1.ServiceInstance, error)
Provision creates an instance of a service class and plan.
func (*SDK) Register ¶
func (sdk *SDK) Register(brokerName string, url string, opts *RegisterOptions) (*v1beta1.ClusterServiceBroker, error)
Register creates a broker
func (*SDK) RetrieveBinding ¶
func (sdk *SDK) RetrieveBinding(ns, name string) (*v1beta1.ServiceBinding, error)
RetrieveBinding gets a binding by its name.
func (*SDK) RetrieveBindings ¶
func (sdk *SDK) RetrieveBindings(ns string) (*v1beta1.ServiceBindingList, error)
RetrieveBindings lists all bindings in a namespace.
func (*SDK) RetrieveBindingsByInstance ¶
func (sdk *SDK) RetrieveBindingsByInstance(instance *v1beta1.ServiceInstance, ) ([]v1beta1.ServiceBinding, error)
RetrieveBindingsByInstance gets all child bindings for an instance.
func (*SDK) RetrieveBroker ¶
func (sdk *SDK) RetrieveBroker(name string) (*v1beta1.ClusterServiceBroker, error)
RetrieveBroker gets a broker by its name.
func (*SDK) RetrieveBrokerByClass ¶
func (sdk *SDK) RetrieveBrokerByClass(class *v1beta1.ClusterServiceClass, ) (*v1beta1.ClusterServiceBroker, error)
RetrieveBrokerByClass gets the parent broker of a class.
func (*SDK) RetrieveBrokers ¶
func (sdk *SDK) RetrieveBrokers(opts ScopeOptions) ([]Broker, error)
RetrieveBrokers lists all brokers defined in the cluster.
func (*SDK) RetrieveClassByID ¶
func (sdk *SDK) RetrieveClassByID(uuid string) (*v1beta1.ClusterServiceClass, error)
RetrieveClassByID gets a class by its UUID.
func (*SDK) RetrieveClassByName ¶
func (sdk *SDK) RetrieveClassByName(name string) (*v1beta1.ClusterServiceClass, error)
RetrieveClassByName gets a class by its external name.
func (*SDK) RetrieveClassByPlan ¶
func (sdk *SDK) RetrieveClassByPlan(plan *v1beta1.ClusterServicePlan, ) (*v1beta1.ClusterServiceClass, error)
RetrieveClassByPlan gets the class associated to a plan.
func (*SDK) RetrieveClasses ¶
func (sdk *SDK) RetrieveClasses(opts ScopeOptions) ([]Class, error)
RetrieveClasses lists all classes defined in the cluster.
func (*SDK) RetrieveInstance ¶
func (sdk *SDK) RetrieveInstance(ns, name string) (*v1beta1.ServiceInstance, error)
RetrieveInstance gets an instance by its name.
func (*SDK) RetrieveInstanceByBinding ¶
func (sdk *SDK) RetrieveInstanceByBinding(b *v1beta1.ServiceBinding, ) (*v1beta1.ServiceInstance, error)
RetrieveInstanceByBinding retrieves the parent instance for a binding.
func (*SDK) RetrieveInstances ¶
func (sdk *SDK) RetrieveInstances(ns, classFilter, planFilter string) (*v1beta1.ServiceInstanceList, error)
RetrieveInstances lists all instances in a namespace.
func (*SDK) RetrieveInstancesByPlan ¶
func (sdk *SDK) RetrieveInstancesByPlan(plan *v1beta1.ClusterServicePlan, ) ([]v1beta1.ServiceInstance, error)
RetrieveInstancesByPlan retrieves all instances of a plan.
func (*SDK) RetrievePlanByClassAndPlanNames ¶
func (sdk *SDK) RetrievePlanByClassAndPlanNames(className, planName string, ) (*v1beta1.ClusterServicePlan, error)
RetrievePlanByClassAndPlanNames gets a plan by its class/plan name combination.
func (*SDK) RetrievePlanByID ¶
func (sdk *SDK) RetrievePlanByID(uuid string) (*v1beta1.ClusterServicePlan, error)
RetrievePlanByID gets a plan by its UUID.
func (*SDK) RetrievePlanByName ¶
func (sdk *SDK) RetrievePlanByName(name string) (*v1beta1.ClusterServicePlan, error)
RetrievePlanByName gets a plan by its external name.
func (*SDK) RetrievePlans ¶
func (sdk *SDK) RetrievePlans(opts RetrievePlanOptions) ([]Plan, error)
RetrievePlans lists all plans defined in the cluster.
func (*SDK) RetrieveSecretByBinding ¶
RetrieveSecretByBinding gets the secret associated with a binding A nil secret is returned without error when the secret has not been created by Service Catalog yet. An error is returned when the binding is Ready but the secret could not be retrieved.
func (*SDK) ServerVersion ¶
ServerVersion asks the Service Catalog API Server for the version.Info object and returns it.
func (*SDK) ServiceCatalog ¶
func (sdk *SDK) ServiceCatalog() v1beta1.ServicecatalogV1beta1Interface
ServiceCatalog is the underlying generated Service Catalog versioned interface It should be used instead of accessing the client directly.
func (*SDK) TouchInstance ¶
TouchInstance increments the updateRequests field on an instance to make service process it again (might be an update, delete, or noop)
func (*SDK) Unbind ¶
func (sdk *SDK) Unbind(ns, instanceName string) ([]types.NamespacedName, error)
Unbind deletes all bindings associated to an instance.
func (*SDK) WaitForBinding ¶
func (sdk *SDK) WaitForBinding(ns, name string, interval time.Duration, timeout *time.Duration) (binding *v1beta1.ServiceBinding, err error)
WaitForBinding waits for the instance to complete the current operation (or fail).
type Scope ¶
type Scope string
Scope is an enum that represents filtering resources by their scope (cluster vs. namespace).
type ScopeOptions ¶
ScopeOptions allows for filtering results based on it's namespace and scope (cluster vs. namespaced).
type SvcatClient ¶
type SvcatClient interface { Bind(string, string, string, string, string, interface{}, map[string]string) (*apiv1beta1.ServiceBinding, error) BindingParentHierarchy(*apiv1beta1.ServiceBinding) (*apiv1beta1.ServiceInstance, *apiv1beta1.ClusterServiceClass, *apiv1beta1.ClusterServicePlan, *apiv1beta1.ClusterServiceBroker, error) DeleteBinding(string, string) error DeleteBindings([]types.NamespacedName) ([]types.NamespacedName, error) IsBindingFailed(*apiv1beta1.ServiceBinding) bool IsBindingReady(*apiv1beta1.ServiceBinding) bool RetrieveBinding(string, string) (*apiv1beta1.ServiceBinding, error) RetrieveBindings(string) (*apiv1beta1.ServiceBindingList, error) RetrieveBindingsByInstance(*apiv1beta1.ServiceInstance) ([]apiv1beta1.ServiceBinding, error) Unbind(string, string) ([]types.NamespacedName, error) WaitForBinding(string, string, time.Duration, *time.Duration) (*apiv1beta1.ServiceBinding, error) Deregister(string) error RetrieveBrokers(opts ScopeOptions) ([]Broker, error) RetrieveBroker(string) (*apiv1beta1.ClusterServiceBroker, error) RetrieveBrokerByClass(*apiv1beta1.ClusterServiceClass) (*apiv1beta1.ClusterServiceBroker, error) Register(string, string, *RegisterOptions) (*apiv1beta1.ClusterServiceBroker, error) Sync(string, int) error RetrieveClasses(ScopeOptions) ([]Class, error) RetrieveClassByName(string) (*apiv1beta1.ClusterServiceClass, error) RetrieveClassByID(string) (*apiv1beta1.ClusterServiceClass, error) RetrieveClassByPlan(*apiv1beta1.ClusterServicePlan) (*apiv1beta1.ClusterServiceClass, error) CreateClass(*apiv1beta1.ClusterServiceClass) (*apiv1beta1.ClusterServiceClass, error) Deprovision(string, string) error InstanceParentHierarchy(*apiv1beta1.ServiceInstance) (*apiv1beta1.ClusterServiceClass, *apiv1beta1.ClusterServicePlan, *apiv1beta1.ClusterServiceBroker, error) InstanceToServiceClassAndPlan(*apiv1beta1.ServiceInstance) (*apiv1beta1.ClusterServiceClass, *apiv1beta1.ClusterServicePlan, error) IsInstanceFailed(*apiv1beta1.ServiceInstance) bool IsInstanceReady(*apiv1beta1.ServiceInstance) bool Provision(string, string, string, string, string, interface{}, map[string]string) (*apiv1beta1.ServiceInstance, error) RetrieveInstance(string, string) (*apiv1beta1.ServiceInstance, error) RetrieveInstanceByBinding(*apiv1beta1.ServiceBinding) (*apiv1beta1.ServiceInstance, error) RetrieveInstances(string, string, string) (*apiv1beta1.ServiceInstanceList, error) RetrieveInstancesByPlan(*apiv1beta1.ClusterServicePlan) ([]apiv1beta1.ServiceInstance, error) TouchInstance(string, string, int) error WaitForInstance(string, string, time.Duration, *time.Duration) (*apiv1beta1.ServiceInstance, error) WaitForInstanceToNotExist(string, string, time.Duration, *time.Duration) (*apiv1beta1.ServiceInstance, error) RetrievePlans(RetrievePlanOptions) ([]Plan, error) RetrievePlanByName(string) (*apiv1beta1.ClusterServicePlan, error) RetrievePlanByID(string) (*apiv1beta1.ClusterServicePlan, error) RetrievePlanByClassAndPlanNames(string, string) (*apiv1beta1.ClusterServicePlan, error) RetrieveSecretByBinding(*apiv1beta1.ServiceBinding) (*apicorev1.Secret, error) ServerVersion() (*version.Info, error) }
SvcatClient is an interface containing the variuos actions in the svcat pkg lib This interface is then faked with Counterfeiter for the cmd/svcat unit tests