https://pulumi.com logo
Title
f

famous-train-38484

08/12/2021, 1:25 PM
[pulumi_kubernetes][python] Hi folks, I've spent a couple of time trying to implement a resource here using the pulumi. I need to set permission for my volume access like 0755 and then I'm trying to write it on the pulumi script in octal mode like 0o755 but it is not working, the pulumi convert for 755. Does anyone here know how can I work around that?
p

prehistoric-activity-61023

08/12/2021, 2:06 PM
can you share a code snippet where you try to set it?
f

famous-train-38484

08/12/2021, 2:08 PM
statefullset = StatefulSet(
    "redis definitions",
    metadata={
        "name": RedisSetup.name
    },
    spec={
        "serviceName": RedisSetup.name,
        "replicas": RedisSetup.replicas,
        "selector": RedisSetup.selector,
        "template": {
            "metadata": RedisSetup.labels,
            "spec": {
                "containers": [{
                    "name": RedisSetup.container_name,
                    "image": RedisSetup.container_image,
                    "ports": RedisSetup.container_ports,
                    "command": ["/conf/update-ip.sh", "redis-server", "/conf/redis.conf"],
                    "env": RedisSetup.env_vars,
                    "volumeMounts": RedisSetup.volumes_mounts
                }],
                "volumes": [
                    {
                        "name": "conf",
                        "configMap": {
                            "name": "redis-cluster-config",
                            "defaultMode": 0o755
                        }
                    }
                ]
            }
        },
        "volumeClaimTemplates": [
            {
                "metadata": RedisSetup.volume_claims_metadata,
                "spec": RedisSetup.volume_claims_spec
            }
        ]
    }
)
@prehistoric-activity-61023
b

billowy-army-68599

08/12/2021, 3:04 PM
Is that a valid octal notation? If it is, you'll need to quote it as a string
f

famous-train-38484

08/13/2021, 1:26 PM
@billowy-army-68599 I've set a '493' in decimal tha means '755' in octal, but I continue get the error, the pulumi just set 755 and them the kubernetes broke because they need a value from 0000 to 0777
to clarify I want to represent this value
volumes:
      - name: conf
        configMap:
          name: redis-cluster-config
          defaultMode: 0755
Fixed. thanks