Skip to content

Commit

Permalink
Fix gateway overriding for faas-cli remove
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
  • Loading branch information
stefanprodan authored and alexellis committed Dec 29, 2017
1 parent 9e50545 commit 644f45d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion commands/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ explicitly specifying a function name.`,

func runDelete(cmd *cobra.Command, args []string) error {
var services stack.Services
var gatewayAddress string
var yamlGateway string
if len(yamlFile) > 0 {
parsedServices, err := stack.ParseYAMLFile(yamlFile, regex, filter)
if err != nil {
Expand All @@ -46,9 +48,12 @@ func runDelete(cmd *cobra.Command, args []string) error {

if parsedServices != nil {
services = *parsedServices
yamlGateway = services.Provider.GatewayURL
}
}

gatewayAddress = getGatewayURL(gateway, defaultGateway, yamlGateway)

if len(services.Functions) > 0 {
if len(services.Provider.Network) == 0 {
services.Provider.Network = defaultNetwork
Expand All @@ -58,7 +63,7 @@ func runDelete(cmd *cobra.Command, args []string) error {
function.Name = k
fmt.Printf("Deleting: %s.\n", function.Name)

proxy.DeleteFunction(services.Provider.GatewayURL, function.Name)
proxy.DeleteFunction(gatewayAddress, function.Name)
}
} else {
if len(args) < 1 {
Expand Down

0 comments on commit 644f45d

Please sign in to comment.