...

Package binding

Overview ▾

Package binding is a generated GoMock package.

Index ▾

type BindingClient
    func NewBindingClient(projectClient project.Client, kubernetesClient kclient.ClientInterface) *BindingClient
    func (o *BindingClient) AddBinding(flags map[string]string, bindingName string, bindAsFiles bool, serviceNs string, namingStrategy string, unstructuredService unstructured.Unstructured, workloadName string, workloadGVK schema.GroupVersionKind) ([]asker.CreationOption, string, string, error)
    func (o *BindingClient) AddBindingToDevfile(componentName string, bindingName string, bindAsFiles bool, serviceNs string, namingStrategy string, unstructuredService unstructured.Unstructured, obj parser.DevfileObj) (parser.DevfileObj, error)
    func (o *BindingClient) AskBindAsFiles(flags map[string]string) (bool, error)
    func (o *BindingClient) AskBindingName(serviceName, componentName string, flags map[string]string) (string, error)
    func (o *BindingClient) AskNamingStrategy(flags map[string]string) (string, error)
    func (o *BindingClient) CheckServiceBindingsInjectionDone(componentName string, appName string) (bool, error)
    func (o *BindingClient) GetBindingFromCluster(name string) (api.ServiceBinding, error)
    func (o *BindingClient) GetBindingsFromDevfile(devfileObj parser.DevfileObj, context string) ([]api.ServiceBinding, error)
    func (o *BindingClient) GetFlags(flags map[string]string) map[string]string
    func (o *BindingClient) GetServiceInstances(namespace string) (map[string]unstructured.Unstructured, error)
    func (o *BindingClient) ListAllBindings(devfileObj *parser.DevfileObj, context string) ([]api.ServiceBinding, []string, error)
    func (o *BindingClient) RemoveBinding(servicebindingName string, obj parser.DevfileObj) (parser.DevfileObj, error)
    func (o *BindingClient) SelectNamespace(flags map[string]string) (string, error)
    func (o *BindingClient) SelectServiceInstance(flags map[string]string, serviceMap map[string]unstructured.Unstructured) (string, error)
    func (o *BindingClient) SelectWorkloadInstance(flags map[string]string) (string, schema.GroupVersionKind, error)
    func (o *BindingClient) ValidateAddBinding(flags map[string]string, withDevfile bool) error
    func (o *BindingClient) ValidateRemoveBinding(flags map[string]string) error
type BindingSet
type Client
type MockClient
    func NewMockClient(ctrl *gomock.Controller) *MockClient
    func (m *MockClient) AddBinding(flags map[string]string, bindingName string, bindAsFiles bool, serviceNs, namingStrategy string, unstructuredService unstructured.Unstructured, workloadName string, workloadGVK schema.GroupVersionKind) ([]asker.CreationOption, string, string, error)
    func (m *MockClient) AddBindingToDevfile(componentName, bindingName string, bindAsFiles bool, serviceNs, namingStrategy string, unstructuredService unstructured.Unstructured, obj parser.DevfileObj) (parser.DevfileObj, error)
    func (m *MockClient) AskBindAsFiles(flags map[string]string) (bool, error)
    func (m *MockClient) AskBindingName(serviceName, componentName string, flags map[string]string) (string, error)
    func (m *MockClient) AskNamingStrategy(flags map[string]string) (string, error)
    func (m *MockClient) CheckServiceBindingsInjectionDone(componentName, appName string) (bool, error)
    func (m *MockClient) EXPECT() *MockClientMockRecorder
    func (m *MockClient) GetBindingFromCluster(name string) (api.ServiceBinding, error)
    func (m *MockClient) GetBindingsFromDevfile(devfileObj parser.DevfileObj, context string) ([]api.ServiceBinding, error)
    func (m *MockClient) GetFlags(flags map[string]string) map[string]string
    func (m *MockClient) GetServiceInstances(namespace string) (map[string]unstructured.Unstructured, error)
    func (m *MockClient) ListAllBindings(devfileObj *parser.DevfileObj, context string) ([]api.ServiceBinding, []string, error)
    func (m *MockClient) RemoveBinding(bindingName string, obj parser.DevfileObj) (parser.DevfileObj, error)
    func (m *MockClient) SelectNamespace(flags map[string]string) (string, error)
    func (m *MockClient) SelectServiceInstance(flags map[string]string, serviceMap map[string]unstructured.Unstructured) (string, error)
    func (m *MockClient) SelectWorkloadInstance(flags map[string]string) (string, schema.GroupVersionKind, error)
    func (m *MockClient) ValidateAddBinding(flags map[string]string, withDevfile bool) error
    func (m *MockClient) ValidateRemoveBinding(flags map[string]string) error
type MockClientMockRecorder
    func (mr *MockClientMockRecorder) AddBinding(flags, bindingName, bindAsFiles, serviceNs, namingStrategy, unstructuredService, workloadName, workloadGVK interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) AddBindingToDevfile(componentName, bindingName, bindAsFiles, serviceNs, namingStrategy, unstructuredService, obj interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) AskBindAsFiles(flags interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) AskBindingName(serviceName, componentName, flags interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) AskNamingStrategy(flags interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) CheckServiceBindingsInjectionDone(componentName, appName interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetBindingFromCluster(name interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetBindingsFromDevfile(devfileObj, context interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetFlags(flags interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) GetServiceInstances(namespace interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) ListAllBindings(devfileObj, context interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) RemoveBinding(bindingName, obj interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) SelectNamespace(flags interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) SelectServiceInstance(flags, serviceMap interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) SelectWorkloadInstance(flags interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) ValidateAddBinding(flags, withDevfile interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) ValidateRemoveBinding(flags interface{}) *gomock.Call

Package files

add.go binding.go interface.go list.go mock.go remove.go

type BindingClient

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

func NewBindingClient

func NewBindingClient(projectClient project.Client, kubernetesClient kclient.ClientInterface) *BindingClient

func (*BindingClient) AddBinding

func (o *BindingClient) AddBinding(
    flags map[string]string,
    bindingName string,
    bindAsFiles bool,
    serviceNs string,
    namingStrategy string,
    unstructuredService unstructured.Unstructured,
    workloadName string,
    workloadGVK schema.GroupVersionKind,
) ([]asker.CreationOption, string, string, error)

func (*BindingClient) AddBindingToDevfile

func (o *BindingClient) AddBindingToDevfile(
    componentName string,
    bindingName string,
    bindAsFiles bool,
    serviceNs string,
    namingStrategy string,
    unstructuredService unstructured.Unstructured,
    obj parser.DevfileObj,
) (parser.DevfileObj, error)

func (*BindingClient) AskBindAsFiles

func (o *BindingClient) AskBindAsFiles(flags map[string]string) (bool, error)

func (*BindingClient) AskBindingName

func (o *BindingClient) AskBindingName(serviceName, componentName string, flags map[string]string) (string, error)

func (*BindingClient) AskNamingStrategy

func (o *BindingClient) AskNamingStrategy(flags map[string]string) (string, error)

func (*BindingClient) CheckServiceBindingsInjectionDone

func (o *BindingClient) CheckServiceBindingsInjectionDone(componentName string, appName string) (bool, error)

func (*BindingClient) GetBindingFromCluster

func (o *BindingClient) GetBindingFromCluster(name string) (api.ServiceBinding, error)

GetBindingFromCluster returns the ServiceBinding resource with the given name from the cluster, from group binding.operators.coreos.com/v1alpha1 or servicebinding.io/v1alpha3

func (*BindingClient) GetBindingsFromDevfile

func (o *BindingClient) GetBindingsFromDevfile(devfileObj parser.DevfileObj, context string) ([]api.ServiceBinding, error)

GetBindingsFromDevfile returns all ServiceBinding resources declared as Kubernertes component from a Devfile from group binding.operators.coreos.com/v1alpha1 or servicebinding.io/v1alpha3 The function also returns status information of the binding in the cluster, if accessible, or a warning if the cluster is not accessible

func (*BindingClient) GetFlags

func (o *BindingClient) GetFlags(flags map[string]string) map[string]string

GetFlags gets the flag specific to add binding operation so that it can correctly decide on the backend to be used It ignores all the flags except the ones specific to add binding operation, for e.g. verbosity flag

func (*BindingClient) GetServiceInstances

func (o *BindingClient) GetServiceInstances(namespace string) (map[string]unstructured.Unstructured, error)

func (*BindingClient) ListAllBindings

func (o *BindingClient) ListAllBindings(devfileObj *parser.DevfileObj, context string) ([]api.ServiceBinding, []string, error)

ListAllBindings returns the list of Service Binding resources either defined in local Devfile or deployed in the current namespace

func (*BindingClient) RemoveBinding

func (o *BindingClient) RemoveBinding(servicebindingName string, obj parser.DevfileObj) (parser.DevfileObj, error)

RemoveBinding removes the binding from devfile

func (*BindingClient) SelectNamespace

func (o *BindingClient) SelectNamespace(flags map[string]string) (string, error)

func (*BindingClient) SelectServiceInstance

func (o *BindingClient) SelectServiceInstance(flags map[string]string, serviceMap map[string]unstructured.Unstructured) (string, error)

func (*BindingClient) SelectWorkloadInstance

func (o *BindingClient) SelectWorkloadInstance(flags map[string]string) (string, schema.GroupVersionKind, error)

func (*BindingClient) ValidateAddBinding

func (o *BindingClient) ValidateAddBinding(flags map[string]string, withDevfile bool) error

ValidateAddBinding calls Validate method of the adequate backend and then checks if the ServiceBinding Operator is installed in the cluster.

func (*BindingClient) ValidateRemoveBinding

func (o *BindingClient) ValidateRemoveBinding(flags map[string]string) error

ValidateRemoveBinding validates if the command has adequate arguments/flags

type BindingSet

BindingSet represents a Set of Bindings, indexed by their names

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

type Client

type Client interface {
    // GetFlags gets the necessary flags for binding
    GetFlags(flags map[string]string) map[string]string
    // GetServiceInstances returns a map of bindable instance name with its unstructured.Unstructured object from the specified namespace, and an error
    GetServiceInstances(namespace string) (map[string]unstructured.Unstructured, error)
    // GetBindingsFromDevfile returns the bindings defined in the devfile with the status extracted from cluster
    GetBindingsFromDevfile(devfileObj parser.DevfileObj, context string) ([]api.ServiceBinding, error)
    // GetBindingFromCluster returns information about a binding in the cluster (either from group binding.operators.coreos.com or servicebinding.io)
    GetBindingFromCluster(name string) (api.ServiceBinding, error)

    // SelectNamespace returns the namespace which services instances should be listed from.
    // An empty return value means that service instances will be listed from the current namespace.
    SelectNamespace(flags map[string]string) (string, error)
    // ValidateAddBinding returns error if the backend failed to validate; mainly useful for flags backend
    // withDevfile indicates if a Devfile is present in the current directory
    ValidateAddBinding(flags map[string]string, withDevfile bool) error
    // SelectServiceInstance returns the service to bind to the component
    SelectServiceInstance(flags map[string]string, serviceMap map[string]unstructured.Unstructured) (string, error)
    // SelectWorkloadInstance returns the workload to bind, when a devfile is not in use
    SelectWorkloadInstance(flags map[string]string) (string, schema.GroupVersionKind, error)
    // AskBindingName returns the name to be set for the binding
    AskBindingName(serviceName, componentName string, flags map[string]string) (string, error)
    // AskBindAsFiles asks if the service should be bound as files
    AskBindAsFiles(flags map[string]string) (bool, error)
    // AskNamingStrategy asks the naming strategy to be used for the binding
    AskNamingStrategy(flags map[string]string) (string, error)
    // AddBindingToDevfile adds the ServiceBinding manifest to the devfile
    AddBindingToDevfile(
        componentName string,
        bindingName string,
        bindAsFiles bool,
        serviceNs string,
        namingStrategy string,
        unstructuredService unstructured.Unstructured,
        obj parser.DevfileObj,
    ) (parser.DevfileObj, error)
    // AddBinding creates a binding in file and cluster (if options selected)
    // and returns the selected options, the binding definition as string (if option selected)
    // and the filename where definition is written (if options selected)
    AddBinding(
        flags map[string]string,
        bindingName string,
        bindAsFiles bool,
        serviceNs string,
        namingStrategy string,
        unstructuredService unstructured.Unstructured,
        workloadName string,
        workloadGVK schema.GroupVersionKind,
    ) (selectedOptions []asker.CreationOption, bindingDef string, filename string, err error)

    // ListAllBindings returns all bindings either defined in the Devfile and/or deployed to the cluster
    // inDevfile contains the names of the bindings at least defined in the devfile
    ListAllBindings(devfileObj *parser.DevfileObj, context string) (bindings []api.ServiceBinding, inDevfile []string, err error)

    // ValidateRemoveBinding validates if the command has adequate arguments/flags
    ValidateRemoveBinding(flags map[string]string) error
    // RemoveBinding removes the binding from devfile
    RemoveBinding(bindingName string, obj parser.DevfileObj) (parser.DevfileObj, error)

    // CheckServiceBindingsInjectionDone checks that all service bindings pointing to component have InjectionReady condition
    CheckServiceBindingsInjectionDone(componentName string, appName string) (bool, error)
}

type MockClient

MockClient is a mock of Client interface.

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

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) AddBinding

func (m *MockClient) AddBinding(flags map[string]string, bindingName string, bindAsFiles bool, serviceNs, namingStrategy string, unstructuredService unstructured.Unstructured, workloadName string, workloadGVK schema.GroupVersionKind) ([]asker.CreationOption, string, string, error)

AddBinding mocks base method.

func (*MockClient) AddBindingToDevfile

func (m *MockClient) AddBindingToDevfile(componentName, bindingName string, bindAsFiles bool, serviceNs, namingStrategy string, unstructuredService unstructured.Unstructured, obj parser.DevfileObj) (parser.DevfileObj, error)

AddBindingToDevfile mocks base method.

func (*MockClient) AskBindAsFiles

func (m *MockClient) AskBindAsFiles(flags map[string]string) (bool, error)

AskBindAsFiles mocks base method.

func (*MockClient) AskBindingName

func (m *MockClient) AskBindingName(serviceName, componentName string, flags map[string]string) (string, error)

AskBindingName mocks base method.

func (*MockClient) AskNamingStrategy

func (m *MockClient) AskNamingStrategy(flags map[string]string) (string, error)

AskNamingStrategy mocks base method.

func (*MockClient) CheckServiceBindingsInjectionDone

func (m *MockClient) CheckServiceBindingsInjectionDone(componentName, appName string) (bool, error)

CheckServiceBindingsInjectionDone mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) GetBindingFromCluster

func (m *MockClient) GetBindingFromCluster(name string) (api.ServiceBinding, error)

GetBindingFromCluster mocks base method.

func (*MockClient) GetBindingsFromDevfile

func (m *MockClient) GetBindingsFromDevfile(devfileObj parser.DevfileObj, context string) ([]api.ServiceBinding, error)

GetBindingsFromDevfile mocks base method.

func (*MockClient) GetFlags

func (m *MockClient) GetFlags(flags map[string]string) map[string]string

GetFlags mocks base method.

func (*MockClient) GetServiceInstances

func (m *MockClient) GetServiceInstances(namespace string) (map[string]unstructured.Unstructured, error)

GetServiceInstances mocks base method.

func (*MockClient) ListAllBindings

func (m *MockClient) ListAllBindings(devfileObj *parser.DevfileObj, context string) ([]api.ServiceBinding, []string, error)

ListAllBindings mocks base method.

func (*MockClient) RemoveBinding

func (m *MockClient) RemoveBinding(bindingName string, obj parser.DevfileObj) (parser.DevfileObj, error)

RemoveBinding mocks base method.

func (*MockClient) SelectNamespace

func (m *MockClient) SelectNamespace(flags map[string]string) (string, error)

SelectNamespace mocks base method.

func (*MockClient) SelectServiceInstance

func (m *MockClient) SelectServiceInstance(flags map[string]string, serviceMap map[string]unstructured.Unstructured) (string, error)

SelectServiceInstance mocks base method.

func (*MockClient) SelectWorkloadInstance

func (m *MockClient) SelectWorkloadInstance(flags map[string]string) (string, schema.GroupVersionKind, error)

SelectWorkloadInstance mocks base method.

func (*MockClient) ValidateAddBinding

func (m *MockClient) ValidateAddBinding(flags map[string]string, withDevfile bool) error

ValidateAddBinding mocks base method.

func (*MockClient) ValidateRemoveBinding

func (m *MockClient) ValidateRemoveBinding(flags map[string]string) error

ValidateRemoveBinding mocks base method.

type MockClientMockRecorder

MockClientMockRecorder is the mock recorder for MockClient.

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

func (*MockClientMockRecorder) AddBinding

func (mr *MockClientMockRecorder) AddBinding(flags, bindingName, bindAsFiles, serviceNs, namingStrategy, unstructuredService, workloadName, workloadGVK interface{}) *gomock.Call

AddBinding indicates an expected call of AddBinding.

func (*MockClientMockRecorder) AddBindingToDevfile

func (mr *MockClientMockRecorder) AddBindingToDevfile(componentName, bindingName, bindAsFiles, serviceNs, namingStrategy, unstructuredService, obj interface{}) *gomock.Call

AddBindingToDevfile indicates an expected call of AddBindingToDevfile.

func (*MockClientMockRecorder) AskBindAsFiles

func (mr *MockClientMockRecorder) AskBindAsFiles(flags interface{}) *gomock.Call

AskBindAsFiles indicates an expected call of AskBindAsFiles.

func (*MockClientMockRecorder) AskBindingName

func (mr *MockClientMockRecorder) AskBindingName(serviceName, componentName, flags interface{}) *gomock.Call

AskBindingName indicates an expected call of AskBindingName.

func (*MockClientMockRecorder) AskNamingStrategy

func (mr *MockClientMockRecorder) AskNamingStrategy(flags interface{}) *gomock.Call

AskNamingStrategy indicates an expected call of AskNamingStrategy.

func (*MockClientMockRecorder) CheckServiceBindingsInjectionDone

func (mr *MockClientMockRecorder) CheckServiceBindingsInjectionDone(componentName, appName interface{}) *gomock.Call

CheckServiceBindingsInjectionDone indicates an expected call of CheckServiceBindingsInjectionDone.

func (*MockClientMockRecorder) GetBindingFromCluster

func (mr *MockClientMockRecorder) GetBindingFromCluster(name interface{}) *gomock.Call

GetBindingFromCluster indicates an expected call of GetBindingFromCluster.

func (*MockClientMockRecorder) GetBindingsFromDevfile

func (mr *MockClientMockRecorder) GetBindingsFromDevfile(devfileObj, context interface{}) *gomock.Call

GetBindingsFromDevfile indicates an expected call of GetBindingsFromDevfile.

func (*MockClientMockRecorder) GetFlags

func (mr *MockClientMockRecorder) GetFlags(flags interface{}) *gomock.Call

GetFlags indicates an expected call of GetFlags.

func (*MockClientMockRecorder) GetServiceInstances

func (mr *MockClientMockRecorder) GetServiceInstances(namespace interface{}) *gomock.Call

GetServiceInstances indicates an expected call of GetServiceInstances.

func (*MockClientMockRecorder) ListAllBindings

func (mr *MockClientMockRecorder) ListAllBindings(devfileObj, context interface{}) *gomock.Call

ListAllBindings indicates an expected call of ListAllBindings.

func (*MockClientMockRecorder) RemoveBinding

func (mr *MockClientMockRecorder) RemoveBinding(bindingName, obj interface{}) *gomock.Call

RemoveBinding indicates an expected call of RemoveBinding.

func (*MockClientMockRecorder) SelectNamespace

func (mr *MockClientMockRecorder) SelectNamespace(flags interface{}) *gomock.Call

SelectNamespace indicates an expected call of SelectNamespace.

func (*MockClientMockRecorder) SelectServiceInstance

func (mr *MockClientMockRecorder) SelectServiceInstance(flags, serviceMap interface{}) *gomock.Call

SelectServiceInstance indicates an expected call of SelectServiceInstance.

func (*MockClientMockRecorder) SelectWorkloadInstance

func (mr *MockClientMockRecorder) SelectWorkloadInstance(flags interface{}) *gomock.Call

SelectWorkloadInstance indicates an expected call of SelectWorkloadInstance.

func (*MockClientMockRecorder) ValidateAddBinding

func (mr *MockClientMockRecorder) ValidateAddBinding(flags, withDevfile interface{}) *gomock.Call

ValidateAddBinding indicates an expected call of ValidateAddBinding.

func (*MockClientMockRecorder) ValidateRemoveBinding

func (mr *MockClientMockRecorder) ValidateRemoveBinding(flags interface{}) *gomock.Call

ValidateRemoveBinding indicates an expected call of ValidateRemoveBinding.

Subdirectories

Name Synopsis
..
asker
backend Package backend is a generated GoMock package.