https://pulumi.com logo
Docs
Join the conversationJoin Slack
Channels
announcements
automation-api
aws
azure
blog-posts
built-with-pulumi
cloudengineering
cloudengineering-support
content-share
contribex
contribute
docs
dotnet
finops
general
getting-started
gitlab
golang
google-cloud
hackathon-03-19-2020
hacktoberfest
install
java
jobs
kubernetes
learn-pulumi-events
linen
localstack
multi-language-hackathon
office-hours
oracle-cloud-infrastructure
plugin-framework
pulumi-cdk
pulumi-crosscode
pulumi-deployments
pulumi-kubernetes-operator
pulumi-service
pulumiverse
python
registry
status
testingtesting123
testingtesting321
typescript
welcome
workshops
yaml
Powered by Linen
python
  • w

    white-balloon-205

    02/24/2019, 4:44 PM
    Got it. Sounds like 400 == o620 is technically a legal value according to Kubernetes.
  • w

    white-balloon-205

    02/24/2019, 4:44 PM
    Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
  • l

    little-river-49422

    02/24/2019, 4:44 PM
    yeah, but its completely NOT transparent
  • w

    white-balloon-205

    02/24/2019, 4:45 PM
    I think that’s just how kubernetes handles this though, right?
  • l

    little-river-49422

    02/24/2019, 4:45 PM
    no, with kubernetes i just type 400 and it doesnt cast it to 620 🙂
  • w

    white-balloon-205

    02/24/2019, 4:47 PM
    Oh - is that really true, the kubernetes api accepts an integer, not a string, in decimal and then automatically reinterprets it as octal?
  • l

    little-river-49422

    02/24/2019, 4:47 PM
    i have no idea 🙂 I'm not any good with go, so I cant even look it up
  • l

    little-river-49422

    02/24/2019, 4:47 PM
    but kubernetes accepts integer, not string
  • l

    little-river-49422

    02/24/2019, 4:47 PM
    and somehow interprets it as 400
  • l

    little-river-49422

    02/24/2019, 4:47 PM
    not 620 🙂
  • w

    white-balloon-205

    02/24/2019, 4:48 PM
    Well, if the same integer value passed to Pulumi results in a different API representation than in a yaml file, that is definitely a bug. But this sounds surprising.
  • w

    white-balloon-205

    02/24/2019, 4:50 PM
    Docs here for example seem to make clear that this is accepted as decimal since there is not support for octal literals in json: https://kubernetes.io/docs/concepts/configuration/secret/
  • w

    white-balloon-205

    02/24/2019, 4:50 PM
    Note that the JSON spec doesn’t support octal notation, so use the value 256 for 0400 permissions. If you use yaml instead of json for the pod, you can use octal notation to specify permissions in a more natural way.
  • l

    little-river-49422

    02/24/2019, 4:50 PM
    yeah, so this is where confusion comes from
  • l

    little-river-49422

    02/24/2019, 4:51 PM
    its trying to be smart, since json doesnt support octal
  • w

    white-balloon-205

    02/24/2019, 4:52 PM
    I don’t think anything is trying to be smart. This is an integer value. You can pass it as a decimal literal or as an octal literal. But it’s just an integer value to kubernetes. No one is doing any conversion of it - not kubernetes, not Pulumi. They’ll just take the integer you provide and use that.
  • l

    little-river-49422

    02/24/2019, 4:53 PM
    sure, but this is completely different to yaml
  • l

    little-river-49422

    02/24/2019, 4:53 PM
    no one is using json to create kubernetes primitives, really
  • w

    white-balloon-205

    02/24/2019, 4:56 PM
    You mean that yaml has octal literals? You can’t pass
    400
    in yaml either. what you can presumably pass is
    0o400
    . I assume in Python you can pass
    0400
    as well?
  • l

    little-river-49422

    02/24/2019, 4:56 PM
    no, in yaml you just do 400
  • l

    little-river-49422

    02/24/2019, 4:57 PM
    m, in my case you do 0400
  • w

    white-balloon-205

    02/24/2019, 4:57 PM
    I really don’t think so. See the yaml example of using default mode in the link I shared above.
  • l

    little-river-49422

    02/24/2019, 5:03 PM
    its 0400
  • l

    little-river-49422

    02/24/2019, 5:04 PM
    i think its yaml for octal
  • h

    helpful-vegetable-35581

    02/24/2019, 5:08 PM
    Leading 0 is octal in yaml
  • w

    white-balloon-205

    02/24/2019, 5:08 PM
    I believe Yaml supports both
    0o400
    and
    0400
    as octal literals. I believe python support
    0400
    for octal literals. (Though there is a proposal to deprecate this and require
    0o400
    ?) I believe JavaScript now only supports
    0o400
    for octal literals (the
    0400
    form was recently deprecated). Json does not support octal literals.
  • l

    little-river-49422

    02/24/2019, 5:09 PM
    no, for python 0400 only works in 2.x i think, in 3+ they force 0oxxx
  • w

    white-balloon-205

    02/24/2019, 5:10 PM
    Ahh - yes - that makes sense. Similar to Javascript. So
    0o400
    is supported in YAML/Python/JavaScript.
  • l

    little-river-49422

    02/24/2019, 5:11 PM
    yeah, i think this confusion comes from yaml files, nevertheless
  • l

    little-river-49422

    02/24/2019, 5:11 PM
    i have lots of them with 420, for example
Powered by Linen
Title
l

little-river-49422

02/24/2019, 5:11 PM
i have lots of them with 420, for example
View count: 1