We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d116157 commit 9c521a4Copy full SHA for 9c521a4
pkg/driver/hooks/options.go
@@ -0,0 +1,39 @@
1
+package hooks
2
+
3
+import (
4
+ "os"
5
6
+ "k8s.io/client-go/kubernetes"
7
+)
8
9
+type Option func(*hook)
10
11
+var defaultOpts = []Option{
12
+ WithNodeName(os.Getenv("KUBE_NODE_NAME")),
13
+}
14
15
+// WithKubernetesClient returns Option to set Kubernetes API client.
16
+func WithKubernetesClient(client kubernetes.Interface) Option {
17
+ return func(h *hook) {
18
+ if client != nil {
19
+ h.client = client
20
+ }
21
22
23
24
+func WithKubernetesClientConfigPath(path string) Option {
25
26
+ if path != "" {
27
+ h.clientCfgPath = path
28
29
30
31
32
+// WithNodeName returns Option to set node node name.
33
+func WithNodeName(name string) Option {
34
35
+ if name != "" {
36
+ h.nodeName = name
37
38
39
0 commit comments