FlowFuse / driver-k8s

Kubernetes container driver for FlowFuse
Apache License 2.0
2 stars 3 forks source link

Cannot start instance with error: Go struct field EnvVar.spec.template.spec.containers.env.value of type string #121

Closed vnStrawHat closed 1 year ago

vnStrawHat commented 1 year ago

Current Behavior

Cannot start instance with error:

{"statusCode":400,"body":{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Deployment in version \"v1\" cannot be handled as a Deployment: json: cannot unmarshal number into Go struct field EnvVar.spec.template.spec.containers.env.value of type string","reason":"BadRequest","code":400}

K8s Deployment ENV

"env": [
              {
                "name": "TZ",
                "value": "Europe/London"
              },
              {
                "name": "FORGE_CLIENT_ID",
                "value": "ffp_1gkCsIqdZKFW8AF-5-1n0BgtFdvnktW64cKwzR7tJ94"
              },
              {
                "name": "FORGE_CLIENT_SECRET",
                "value": "GjML-nMDCIRxvFEN3a4fnjG4w3imSHzpbs2xW56hURRtApOBTxYrreswDd0RpJLs"
              },
              {
                "name": "FORGE_URL",
                "value": "http://forge.flowforge"
              },
              {
                "name": "BASE_URL",
                "value": "https://precious-purple-sandpiper-7561.forge.k8s.xxx"
              },
              {
                "name": "FORGE_TEAM_ID",
                "value": "34qaN4xX5v"
              },
              {
                "name": "FORGE_PROJECT_ID",
                "value": "8dcb5b43-06fe-4541-ae3f-2695027c9ec0"
              },
              {
                "name": "FORGE_PROJECT_TOKEN",
                "value": "fft_R0qEj6XaI-UN4uPjJNhu2xR8xKtNgvWPfDaUFnOzOnE"
              },
              {
                "name": "FORGE_NR_NO_TCP_IN",
                "value": "true"
              },
              {
                "name": "FORGE_NR_NO_UDP_IN",
                "value": "true"
              },
              {
                "name": "FORGE_BROKER_URL",
                "value": "mqtt://flowforge-broker.flowforge:1883"
              },
              {
                "name": "FORGE_BROKER_USERNAME",
                "value": "project:34qaN4xX5v:8dcb5b43-06fe-4541-ae3f-2695027c9ec0"
              },
              {
                "name": "FORGE_BROKER_PASSWORD",
                "value": "ffbp_cU0eStkmHZnT_1TliMcMmASelIn8ZCcscXflCnLZQMQ"
              },
              {
                "name": "FORGE_LICENSE_TYPE",
                "value": "ee"
              },
              {
                "name": "FORGE_MEMORY_LIMIT",
                "value": 256
              },
              {
                "name": "FORGE_CPU_LIMIT",
                "value": 10
              },
              {
                "name": "FORGE_NR_SECRET",
                "value": "54b4a8c405a487e67d83121a58440f26ce4bddb3ddd1ab10127c31bce0b0c494"
              }
            ],

Maybe issue related to FORGE_MEMORY_LIMIT and FORGE_CPU_LIMIT with value is int instead of string

Expected Behavior

No response

Steps To Reproduce

No response

Environment

hardillb commented 1 year ago

What version of Kubernetes are you running on?

I'm not seeing that error on 1.23 (just checking on 1.24)

vnStrawHat commented 1 year ago

I'm using Kubernetes v1.25.6

hardillb commented 1 year ago

OK, working on 1.24 as well, but I think you are correct and I will open a PR to force the values to strings.

hardillb commented 1 year ago

Should be in release at the end of the week