app icon indicating copy to clipboard operation
app copied to clipboard

Disabling a node in YAML should be explicit

Open silvin-lubecki opened this issue 6 years ago • 3 comments

Description

A YAML node can be disabled using a "enabled" key with a value:

version: "3.4"
services:
  monitor:
    enabled: "! ${myapp.debug}"

But the code handling this feature says that no value means disabling the node too:

version: "3.4"
services:
  monitor:
    enabled: # monitor is disabled

I suggest we should remove this implicit disable with no value, and error out, as I think that enabling should be explicit too.

⚠️ We should also add unit tests on this part!!

silvin-lubecki avatar Jun 29 '18 14:06 silvin-lubecki

@silvin-lubecki I see https://github.com/docker/app/pull/244 was merged. Did it take this into account?

chris-crone avatar Aug 21 '18 15:08 chris-crone

The code is now at https://github.com/docker/app/blob/master/render/render.go#L135...L157 (and the key is x-enabled). By my reading it still has the same behaviour which @silvin-lubecki proposed changing.

ijc avatar Jan 21 '19 11:01 ijc

Is it available for new contributors?

shreyasbapat avatar Feb 22 '19 12:02 shreyasbapat