Skip to content

Commit d562498

Browse files
authored
fix: delete and `deploy sub-commands respects func.yaml conf
1 parent beb838f commit d562498

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

cmd/delete.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ func runDelete(cmd *cobra.Command, args []string) (err error) {
5252
return fmt.Errorf("the given path '%v' does not contain an initialized Function.", config.Path)
5353
}
5454

55-
remover, err := knative.NewRemover(config.Namespace)
55+
ns := config.Namespace
56+
if ns == "" {
57+
ns = function.Namespace
58+
}
59+
60+
remover, err := knative.NewRemover(ns)
5661
if err != nil {
5762
return
5863
}

cmd/deploy.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ func runDeploy(cmd *cobra.Command, _ []string) (err error) {
9595
pusher := docker.NewPusher()
9696
pusher.Verbose = config.Verbose
9797

98-
deployer, err := knative.NewDeployer(config.Namespace)
98+
ns := config.Namespace
99+
if ns == "" {
100+
ns = function.Namespace
101+
}
102+
103+
deployer, err := knative.NewDeployer(ns)
99104
if err != nil {
100105
return
101106
}

0 commit comments

Comments
 (0)