Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Invalid interpolation of the variables with the 'no' value #577

Open
johnbizokk opened this issue Jul 19, 2019 · 2 comments
Open

Invalid interpolation of the variables with the 'no' value #577

johnbizokk opened this issue Jul 19, 2019 · 2 comments
Labels

Comments

@johnbizokk
Copy link

johnbizokk commented Jul 19, 2019

Description

When we try to use no as the value of a variable, the docker app interpolates the value as the false. When we cover the value of the variable with single or double quotes - the problem disappears (with the v0.7.3 binary / with the v0.8.0 binary, the workaround does not work).

I also attached the working examples - see the Annex №5,6,7,8 below (for v0.7.3).

Steps to reproduce the issue: - v0.7.3

  1. Have the docker-compose file with the following content - see the Annex №1 below.
  2. Have the parameters.yml file with the following content - see the Annex №2 below.
  3. Have the parameters.yml file with the following content - see the Annex №3 below.
  4. Execute the following render command - docker-app-standalone-linux render.
  5. Receive the invalid render output - see the Annex №4 below.

Steps to reproduce the issue: - v0.8.0

  1. Have the docker-compose file with the following content - see the Annex №9 below.
  2. Have the parameters.yml file with the following content - see the Annex №10 below.
  3. Have the parameters.yml file with the following content - see the Annex №11 below.
  4. Execute the following render command - docker-app-standalone-linux render.
  5. Receive the invalid render output - see the Annex №12 below.

Describe the results you received:

Unfortunately, we've got the invalid output. It took some time to figure out why we have got the wrong value in the rendered compose file. As a temporary crutch, we have covered this value with single or double quotes, and we have switched to the older version.

Describe the results you expected:

We expect correct interpolation of the values of the variables from the docker-app binary.

Output of docker version:

Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        2d0083d
 Built:             Thu Jun 27 17:56:06 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.7
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       2d0083d
  Built:            Thu Jun 27 17:26:28 2019
  OS/Arch:          linux/amd64
  Experimental:     true

Output of docker-app version: - latest binary

Version:               v0.8.0
Git commit:            7eea32b7
Built:                 Tue Jun 11 20:53:26 2019
OS/Arch:               linux/amd64
Experimental:          off
Renderers:             none
Invocation Base Image: docker/cnab-app-base:v0.8.0

Output of docker-app version: - binary in use

Version:      v0.7.3
Git commit:   332efaa
Built:        Fri Nov 30 15:17:53 2018
OS/Arch:      linux/amd64
Experimental: off
Renderers:    none

Output of docker info:

Containers: X
 Running: X
 Paused: X
 Stopped: X
Images: X
Server Version: 18.09.7
Storage Driver: overlay2
 Backing Filesystem: xfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: local
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: active
 NodeID: ID
 Is Manager: true
 ClusterID: ID
 Managers: X
 Nodes: X
 Default Address Pool: 10.0.0.0/8
 SubnetSize: 24
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 10
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address:  IPADDR
 Manager Addresses:
 IPADDR
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-957.21.3.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 55.86GiB
Name: hostname
ID: ID
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Registry Mirrors:
 http://localhost:6000/
Live Restore Enabled: false
Product License: Community Engine

Annex №1 (docker-compose.yml) - invalid interpolation - group №1 - v0.7.3

version: '3.7'
services:
  application:
    x-enabled: "${enable-application}"
    image: "image"
    labels:
     proxy: ${proxy}

Annex №2 (parameters.yml) - invalid interpolation - group №1 - v0.7.3

enable-application: true
proxy: no

Annex №3 (metadata.yml) - invalid interpolation - group №1 - v0.7.3

version: 1.0.0
name: application
description: "application bundle"
namespace: "namespace"
maintainers:
  - name: Maintainer
    email: "[email protected]"

Annex №4 (stdout output) - invalid interpolation - group №1 - v0.7.3

version: "3.7"
services:
  application:
    image: image
    labels:
      proxy: "false"
    x-enabled: "true"

Annex №5 (docker-compose.yml) - valid interpolation - group №2 - v0.7.3

version: '3.7'
services:
  application:
    x-enabled: "${enable-application}"
    image: "image"
    labels:
     proxy: ${proxy}

Annex №6 (parameters.yml) - valid interpolation - group №2 - v0.7.3

enable-application: true
proxy: 'no'

Annex №7 (metadata.yml) - valid interpolation - group №2 - v0.7.3

version: 1.0.0
name: application
description: "application bundle"
namespace: "namespace"
maintainers:
  - name: Maintainer
    email: "[email protected]"

Annex №8 (stdout output) - valid interpolation - group №2 - v0.7.3

version: "3.7"
services:
  application:
    image: image
    labels:
      proxy: "no"
    x-enabled: "true"

Annex №9 (docker-compose.yml) - invalid interpolation - group №3 - v0.8.0

version: '3.7'
services:
  application:
    x-enabled: "${enable-application}"
    image: "image"
    labels:
     var1: ${var1}
     var2: ${var2}
     var3: ${var3}

Annex №10 (parameters.yml) - invalid interpolation - group №3 - v0.8.0

enable-application: true
var1: no
var2: 'no'
var3: "no"

Annex №11 (metadata.yml) - invalid interpolation - group №3 - v0.8.0

version: 1.0.0
name: application
description: "application bundle"
namespace: "namespace"
maintainers:
  - name: Maintainer
    email: "[email protected]"

Annex №12 (stdout output) - invalid interpolation - group №3 - v0.8.0

version: "3.7"
services:
  application:
    image: image
    labels:
      var1: "false"
      var2: "false"
      var3: "false"
    x-enabled: "true"
@jcsirot
Copy link
Contributor

jcsirot commented Jul 20, 2019

Hi @johnbizokk, thank you for filling this issue.

@jcsirot
Copy link
Contributor

jcsirot commented Jul 26, 2019

Hi @johnbizokk we tracked that bug and found it is related to the yaml parser which parses strings like "no" or "off" as boolean and render them with their canonical values "true" and "false".
Actually this issue has a deeper impact than we initially thought. We are now working on fix but it would take some time. Unfortunately so far I do not have any workaround for the 0.8.0 version 😭

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants