...
1 package binding
2
3 import (
4 "github.com/devfile/library/v2/pkg/devfile/parser"
5 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
6 "k8s.io/apimachinery/pkg/runtime/schema"
7
8 "github.com/redhat-developer/odo/pkg/api"
9 "github.com/redhat-developer/odo/pkg/binding/asker"
10 )
11
12 type Client interface {
13
14 GetFlags(flags map[string]string) map[string]string
15
16 GetServiceInstances(namespace string) (map[string]unstructured.Unstructured, error)
17
18 GetBindingsFromDevfile(devfileObj parser.DevfileObj, context string) ([]api.ServiceBinding, error)
19
20 GetBindingFromCluster(name string) (api.ServiceBinding, error)
21
22
23
24
25
26 SelectNamespace(flags map[string]string) (string, error)
27
28
29 ValidateAddBinding(flags map[string]string, withDevfile bool) error
30
31 SelectServiceInstance(flags map[string]string, serviceMap map[string]unstructured.Unstructured) (string, error)
32
33 SelectWorkloadInstance(flags map[string]string) (string, schema.GroupVersionKind, error)
34
35 AskBindingName(serviceName, componentName string, flags map[string]string) (string, error)
36
37 AskBindAsFiles(flags map[string]string) (bool, error)
38
39 AskNamingStrategy(flags map[string]string) (string, error)
40
41 AddBindingToDevfile(
42 componentName string,
43 bindingName string,
44 bindAsFiles bool,
45 serviceNs string,
46 namingStrategy string,
47 unstructuredService unstructured.Unstructured,
48 obj parser.DevfileObj,
49 ) (parser.DevfileObj, error)
50
51
52
53 AddBinding(
54 flags map[string]string,
55 bindingName string,
56 bindAsFiles bool,
57 serviceNs string,
58 namingStrategy string,
59 unstructuredService unstructured.Unstructured,
60 workloadName string,
61 workloadGVK schema.GroupVersionKind,
62 ) (selectedOptions []asker.CreationOption, bindingDef string, filename string, err error)
63
64
65
66
67
68 ListAllBindings(devfileObj *parser.DevfileObj, context string) (bindings []api.ServiceBinding, inDevfile []string, err error)
69
70
71
72
73 ValidateRemoveBinding(flags map[string]string) error
74
75 RemoveBinding(bindingName string, obj parser.DevfileObj) (parser.DevfileObj, error)
76
77
78 CheckServiceBindingsInjectionDone(componentName string, appName string) (bool, error)
79 }
80
View as plain text