Ephemeral Nodes for via Session behavior settings.

Added a "delete" behavior for session invalidation, in addition to
the default "release" behavior. On session invalidation, the sessions
Behavior field is checked and if it is set to "delete", all nodes owned
by the session are deleted. If it is "release", then just the locks
are released as default.

Crack at implementing: https://github.com/hashicorp/consul/issues/238
OK, agreed. Will fix this and the other file as well.

On Nov 20, 2014 5:58 PM, Armon Dadgar <notifications@github.com> wrote:

In consul/session_endpoint.go:

> @@ -28,6 +28,13 @@ func (s *Session) Apply(args *structs.SessionRequest, reply *string) error {
>       if args.Session.Node == "" && args.Op == structs.SessionCreate {
>               return fmt.Errorf("Must provide Node")
>       }
> +     switch args.Session.Behavior {


I think there should be a case for the empty string which does default, and return an error in the default case. e.g. behavior = foobar should return an error.

—
Reply to this email directly or view it on GitHub<https://github.com/hashicorp/consul/pull/487/files#r20684732>.