Closed zadigus closed 4 years ago
/set title: Question on deleting functions from multiple-namespaces
@LucasRoesler please could you take this one?
Sure, I wont have much time to dedicate until tomorrow, but i will take a look.
I took a very brief look at the remove
command and the bug is pretty clear to me, this line only references the namespace from the flag
I am starting to think that we should consider changing the implementation in the CLI so that the yaml parser can accept an overrides
object and hopefully implement the overrides consistently.
// StackOverrides contains the optional values that can be overridden in the stack.yaml
// when the file is being parsed.
//
// StackOverrides is generally constructed from the CLI flags.
type StackOverrides struct {
// Namespace sets the namespace of all functions in the stack to the given value
Namespace *string
//... etc
}
// SetNamespace is a helper for configuring the namespace override
func (o *StackOverrides) SetNamespace(v string) {
o = &v
}
The quick fix is going to look similar to the patch we just did on the deploy command
@LucasRoesler can this be closed after #812 was merged? I am asking because normally when Closes / Fixes:
is added to a PR it will automatically close the linked Issue.
yes
In what release will that fix be available? Thanks for your prompt fix, btw.
It's already been released, you can get regular updates via the Insiders Updates or read the release notes on this repo under the releases tab to find out which.
I have the following
faas-stack.yml
:I can up the stack like this:
That works, though I've been struggling a lot trying to make it work. Indeed, I get the following confirmation:
Now, my issue is that the following command does not remove the functions declared in my stack:
Even though I get the confirmation
the function is actually not removed. Instead, I need to call
Then I get the confirmation
and the function is really removed. From that behavior, I understand the
namespace
value in thefaas-stack.yml
is ignored in theremove
command, which is surprising.Expected Behaviour
The command
should provide the same result as the command
in that simple case where I only have one function. Of course, with more functions, the former command should successfully remove all the functions from the namespace specified in the yaml file.
Current Behaviour
The command
has no effect in the specified namespace.
Possible Solution
Currently, my work-around is to manually remove all the functions from the stack with commands like:
Of course, that's annoying, because I have a stack file with my whole defined there! I don't want to type one line of code for each function I have in my stack. I'd rather like to use the stack, which works for deployment.
Steps to Reproduce (for bugs)
See that your functions are up.
See that your functions are still up and never vanish from your function namespace.
Context
I'm pretty new to openfaas. I started using it this week. I am trying to deploy my .Net Core functions to my k8s cluster in the simplest possible way. I have already a pretty big stack of helm charts to deploy, together with functions that I am currently developping for my e-commerce platform.
Your Environment
faas-cli version
):docker version
):Server: Docker Engine - Community Engine: Version: 19.03.8 API version: 1.40 (minimum version 1.12) Go version: go1.12.17 Git commit: afacb8b Built: Wed Mar 11 01:29:16 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.2.13 GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683
Client Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:26:26Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"windows/amd64"} Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:18:29Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}