2017-06-21 49 views
3

是否有方法爲spec.container.env.value傳遞一個布爾值? 我要重寫,與掌舵,碼頭工人,父母圖像中的布爾ENV變量(https://github.com/APSL/docker-thumbor):UPLOAD_ENABLEDDocker如何在spec.container.env.value上使用布爾值

我做了一個簡單的測試

如果您嘗試以下YAML:

apiVersion: v1 
kind: Pod 
metadata: 
    name: envar-demo 
    labels: 
    purpose: demonstrate-envars 
spec: 
    containers: 
    - name: envar-demo-container 
    image: gcr.io/google-samples/node-hello:1.0 
    env: 
    - name: DEMO_GREETING 
     value: true 

並嘗試以kubernetes創建它,你得到了以下錯誤:

kubectl create -f envars.yaml 

錯誤:

error: error validating "envars.yaml": error validating data: expected type string, for field spec.containers[0].env[0].value, got bool; if you choose to ignore these errors, turn validation off with --validate=false 

與驗證=假

Error from server (BadRequest): error when creating "envars.yaml": Pod in version "v1" cannot be handled as a Pod: [pos 192]: json: expect char '"' but got char 't' 

它不與整數值過於

回答