dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

Configure multi-line value env inside deployment yaml return 500

Open Colstuwjx opened this issue 4 years ago • 4 comments

Environment
Installation method: Deployment
Kubernetes version: v1.15.3
Dashboard version: v1.10.1
Operating system: CentOS 7.1
Node.js version ('node --version' output):
Go version ('go version' output):
Steps to reproduce
  1. edit a deployment, set the env name-value pair with the following:
      "spec": {
        "containers": [
          {
            "name": "main",
            "image": "xxx",
            "env": [
              {
                "name": "WORKS_ENV_NAME",
                "value": "WORKS_VALUE"
              },
              {
                "name": "ERROR_ENV_NAME",
                "value": "
    catalina.fields.service=nginx-log
    catalina.multiline.pattern='^\['
    catalina.multiline.negate=true
    catalina.multiline.match=after"
              }
...
  1. while I click save, dashboard would throws error like the below:
Called API: https://DASHBOARD_DOMAIN/api/v1/_raw/deployment/namespace/NS/name/DEPLOYMENT_NAME
PUT HTTP 500
invalid character '\n' in string literal
Observed result

As the result, it throws invalid character '\n' in string literal

Expected result

Dashboard should support multi-line env value, and pod could read the env value as usual.

Comments

Colstuwjx avatar Dec 12 '19 09:12 Colstuwjx

Test that on latest v2 beta. v1 is not supported anymore.

floreks avatar Dec 12 '19 09:12 floreks

Hi @floreks ,

I have been tested such multi-line env settings on Dashboard v2.0.0-beta8+0.g4275399, there is no error output, instead, for example, if I want to set env CUSTOM_CONFIG with value

# multi-line with \n
catalina.fields.service=nginx-log
catalina.multiline.pattern='^\['
catalina.multiline.negate=true
catalina.multiline.match=after

The result was the CUSTOM_CONFIG set by value null. You can also have a try, it's easy to reproduce.

Thanks.

Colstuwjx avatar Dec 13 '19 02:12 Colstuwjx

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Mar 12 '20 03:03 fejta-bot

/remove-lifecycle stale any help on multiline/multivlaue variables ?

Mohkam avatar Mar 31 '21 18:03 Mohkam