File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 7
7
"time"
8
8
9
9
"github.com/appscode/go/log"
10
+ "github.com/appscode/kutil"
10
11
scs "github.com/appscode/stash/client/typed/stash/v1alpha1"
11
12
"github.com/appscode/stash/pkg/scheduler"
12
13
"github.com/appscode/stash/pkg/util"
@@ -23,7 +24,7 @@ func NewCmdSchedule() *cobra.Command {
23
24
kubeconfigPath string
24
25
workload string
25
26
opt scheduler.Options = scheduler.Options {
26
- Namespace : namespace (),
27
+ Namespace : kutil . Namespace (),
27
28
ResticName : "" ,
28
29
ScratchDir : "/tmp" ,
29
30
PushgatewayURL : "http://stash-operator.kube-system.svc:56789" ,
@@ -136,15 +137,3 @@ func NewCmdSchedule() *cobra.Command {
136
137
137
138
return cmd
138
139
}
139
-
140
- func namespace () string {
141
- if ns := os .Getenv ("OPERATOR_NAMESPACE" ); ns != "" {
142
- return ns
143
- }
144
- if data , err := ioutil .ReadFile ("/var/run/secrets/kubernetes.io/serviceaccount/namespace" ); err == nil {
145
- if ns := strings .TrimSpace (string (data )); len (ns ) > 0 {
146
- return ns
147
- }
148
- }
149
- return metav1 .NamespaceDefault
150
- }
You can’t perform that action at this time.
0 commit comments