File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -244,14 +244,24 @@ func runDeploy(cmd *cobra.Command, newClient ClientFactory) (err error) {
244
244
if f , err = fn .NewFunction (cfg .Path ); err != nil {
245
245
return
246
246
}
247
- if ! f .Initialized () {
248
- return fn .NewErrNotInitialized (f .Root )
249
- }
250
247
if f , err = cfg .Configure (f ); err != nil { // Updates f with deploy cfg
251
248
return
252
249
}
253
250
cmd .SetContext (cfg .WithValues (cmd .Context ())) // Some optional settings are passed via context
254
251
252
+ if ! f .Initialized () {
253
+ if ! cfg .Remote || f .Build .Git .URL == "" {
254
+ // Only error if this is not a fully remote build
255
+ return fn .NewErrNotInitialized (f .Root )
256
+ } else {
257
+ // TODO: this case is not supported because the pipeline
258
+ // implementation requires the function's name, which is in the
259
+ // remote repository. We should inspect the remote repository.
260
+ // For now, give a more helpful error.
261
+ return errors .New ("please ensure the function's source is also available locally" )
262
+ }
263
+ }
264
+
255
265
changingNamespace := func (f fn.Function ) bool {
256
266
// We're changing namespace if:
257
267
return f .Deploy .Namespace != "" && // it's already deployed
You can’t perform that action at this time.
0 commit comments