fix: `delete` and `deploy sub-commands respects func.yaml conf

This commit is contained in:
Matej Vasek 2020-11-06 17:19:10 +01:00 committed by GitHub
parent beb838ff43
commit d5624980d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -52,7 +52,12 @@ func runDelete(cmd *cobra.Command, args []string) (err error) {
return fmt.Errorf("the given path '%v' does not contain an initialized Function.", config.Path)
}
remover, err := knative.NewRemover(config.Namespace)
ns := config.Namespace
if ns == "" {
ns = function.Namespace
}
remover, err := knative.NewRemover(ns)
if err != nil {
return
}

View File

@ -95,7 +95,12 @@ func runDeploy(cmd *cobra.Command, _ []string) (err error) {
pusher := docker.NewPusher()
pusher.Verbose = config.Verbose
deployer, err := knative.NewDeployer(config.Namespace)
ns := config.Namespace
if ns == "" {
ns = function.Namespace
}
deployer, err := knative.NewDeployer(ns)
if err != nil {
return
}