[pulumi_kubernetes][python] Hi folks, I've spent a...
# getting-started
f
[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
can you share a code snippet where you try to set it?
f
Copy code
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
Is that a valid octal notation? If it is, you'll need to quote it as a string
f
@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
Copy code
volumes:
      - name: conf
        configMap:
          name: redis-cluster-config
          defaultMode: 0755
Fixed. thanks