@@ -51,14 +51,6 @@ func GetRunFnRunner(name string) *RunFnRunner {
51
51
"enable support for exec functions -- note: exec functions run arbitrary code -- do not use for untrusted configs!!! (Alpha)" )
52
52
r .Command .Flags ().StringVar (
53
53
& r .ExecPath , "exec-path" , "" , "run an executable as a function. (Alpha)" )
54
- r .Command .Flags ().BoolVar (
55
- & r .EnableStar , "enable-star" , false , "enable support for starlark functions. (Alpha)" )
56
- r .Command .Flags ().StringVar (
57
- & r .StarPath , "star-path" , "" , "run a starlark script as a function. (Alpha)" )
58
- r .Command .Flags ().StringVar (
59
- & r .StarURL , "star-url" , "" , "run a starlark script as a function. (Alpha)" )
60
- r .Command .Flags ().StringVar (
61
- & r .StarName , "star-name" , "" , "name of starlark program. (Alpha)" )
62
54
63
55
r .Command .Flags ().StringVar (
64
56
& r .ResultsDir , "results-dir" , "" , "write function results to this dir" )
@@ -91,7 +83,6 @@ type RunFnRunner struct {
91
83
GlobalScope bool
92
84
FnPaths []string
93
85
Image string
94
- EnableStar bool
95
86
StarPath string
96
87
StarURL string
97
88
StarName string
@@ -128,8 +119,6 @@ func (r *RunFnRunner) getContainerFunctions(dataItems []string) (
128
119
switch {
129
120
case r .Image != "" :
130
121
fnAnnotation , err = fnAnnotationForImage (r .Image , r .Network )
131
- case r .EnableStar && (r .StarPath != "" || r .StarURL != "" ):
132
- fnAnnotation , err = fnAnnotationForStar (r .StarPath , r .StarURL , r .StarName )
133
122
case r .EnableExec && r .ExecPath != "" :
134
123
fnAnnotation , err = fnAnnotationForExec (r .ExecPath )
135
124
}
@@ -218,37 +207,6 @@ func fnAnnotationForExec(path string) (*yaml.RNode, error) {
218
207
return fn , nil
219
208
}
220
209
221
- func fnAnnotationForStar (path string , url string , name string ) (* yaml.RNode , error ) {
222
- fn , err := yaml .Parse (`starlark: {}` )
223
- if err != nil {
224
- return nil , errors .Wrap (err )
225
- }
226
-
227
- if path != "" {
228
- err = fn .PipeE (
229
- yaml .Lookup ("starlark" ),
230
- yaml .SetField ("path" , yaml .NewScalarRNode (path )))
231
- if err != nil {
232
- return nil , errors .Wrap (err )
233
- }
234
- }
235
- if url != "" {
236
- err = fn .PipeE (
237
- yaml .Lookup ("starlark" ),
238
- yaml .SetField ("url" , yaml .NewScalarRNode (url )))
239
- if err != nil {
240
- return nil , errors .Wrap (err )
241
- }
242
- }
243
- err = fn .PipeE (
244
- yaml .Lookup ("starlark" ),
245
- yaml .SetField ("name" , yaml .NewScalarRNode (name )))
246
- if err != nil {
247
- return nil , errors .Wrap (err )
248
- }
249
- return fn , nil
250
- }
251
-
252
210
func fnAnnotationForImage (image string , enableNetwork bool ) (* yaml.RNode , error ) {
253
211
fn , err := yaml .Parse (`container: {}` )
254
212
if err != nil {
@@ -286,16 +244,11 @@ func toStorageMounts(mounts []string) []runtimeutil.StorageMount {
286
244
}
287
245
288
246
func (r * RunFnRunner ) preRunE (c * cobra.Command , args []string ) error {
289
- if ! r .EnableStar && (r .StarPath != "" || r .StarURL != "" ) {
290
- return errors .Errorf ("must specify --enable-star with --star-path and --star-url" )
291
- }
292
-
293
247
if ! r .EnableExec && r .ExecPath != "" {
294
248
return errors .Errorf ("must specify --enable-exec with --exec-path" )
295
249
}
296
250
297
- if c .ArgsLenAtDash () >= 0 && r .Image == "" &&
298
- ! (r .EnableStar && (r .StarPath != "" || r .StarURL != "" )) && ! (r .EnableExec && r .ExecPath != "" ) {
251
+ if c .ArgsLenAtDash () >= 0 && r .Image == "" && ! (r .EnableExec && r .ExecPath != "" ) {
299
252
return errors .Errorf ("must specify --image" )
300
253
}
301
254
@@ -346,7 +299,6 @@ func (r *RunFnRunner) preRunE(c *cobra.Command, args []string) error {
346
299
Input : input ,
347
300
Path : path ,
348
301
Network : r .Network ,
349
- EnableStarlark : r .EnableStar ,
350
302
EnableExec : r .EnableExec ,
351
303
StorageMounts : storageMounts ,
352
304
ResultsDir : r .ResultsDir ,
0 commit comments