Open mcadac opened 5 years ago
The number 432
is the decimal form of the octal 0660
.
Looks like it's properly read as octal but rendered on its decimal format.
Not sure if we can do anything about it, might require a patch in the upstream yaml parsing/rendering package
Using some sort of type octalMode int
and then func (o octalMode) SomeInterfaceMethodToRenderIt
is usually enough. If app
is using the gopkg.in/yaml.v2
parser then MarshalYAML
is the SomeInterfaceMethodToRenderIt
you need.
Doesn't quite help if you need to preserve whatever was written (i.e. want to support keeping decimal input as is). For that I think you'd basically need a string... But rendering mode unconditionally as octal seems like it wouldn't be too bad.
Good call @ijc. Would need to happen in Docker CLI though. Adding the flag.
@ijc I've tried to print it unconditionally as octal before but it renders as a string.
I've issued that in https://github.com/go-yaml/yaml/issues/420
Using some sort of
type octalMode int
and thenfunc (o octalMode) SomeInterfaceMethodToRenderIt
is usually enough. Ifapp
is using thegopkg.in/yaml.v2
parser thenMarshalYAML
is theSomeInterfaceMethodToRenderIt
you need.Doesn't quite help if you need to preserve whatever was written (i.e. want to support keeping decimal input as is). For that I think you'd basically need a string... But rendering mode unconditionally as octal seems like it wouldn't be too bad.
@ijc That's right, but in this case, we need to preserve the value because it is file permission in our container, and then when we run container it generates an error for this reason.
Description
docker-app render changes "mode" property value of the configs when the numeric value start with "0"
Steps to reproduce the issue:
Create a docker-compose with a config mode like this
Execute docker-app render
Describe the results you received:
Describe the results you expected:
Output of
docker version
:Output of
docker-app version
: