pod-spec-set converts config value of 'yes' to 'true'

Bug #1796202 reported by Jason Hobbs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Ian Booth

Bug Description

I have a spec_template.yaml that looks like this:

containers:
  - name: $name
    imageDetails:
      imagePath: $docker_image_path
      username: $docker_image_username
      password: $docker_image_password
    ports:
    - containerPort: $port
      protocol: TCP
    config:
        ALLOW_ANONYMOUS_LOGIN: 'yes'

Even though I've specified the value of ALLOW_ANONYMOUS_LOGIN as the string 'yes', it's being converted to a boolean and output as true in the container's environment:

            "Env": [
                "ALLOW_ANONYMOUS_LOGIN=true",

My container is expecting the string 'yes', not 'true', so this breaks it.

This is with 2.5-beta1+develop-db4f51c

Tags: cdo-qa osm
Revision history for this message
Anastasia (anastasia-macmood) wrote :

This might be a yaml parsing rather than Juju. I'll look to see if there is a fix or a workaround.

Revision history for this message
Jason Hobbs (jason-hobbs) wrote : Re: [Bug 1796202] Re: pod-spec-set converts config value of 'yes' to 'true'

yeah - I don't know if the source of the bug is in yaml parsing code or
juju code.

however parsing 'yes' in a working yaml parser gives the string 'yes', not
a boolean value.

On Thu, Oct 4, 2018 at 6:21 PM Anastasia <email address hidden>
wrote:

> This might be a yaml parsing rather than Juju. I'll look to see if there
> is a fix or a workaround.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1796202
>
> Title:
> pod-spec-set converts config value of 'yes' to 'true'
>
> Status in juju:
> New
>
> Bug description:
> I have a spec_template.yaml that looks like this:
>
> containers:
> - name: $name
> imageDetails:
> imagePath: $docker_image_path
> username: $docker_image_username
> password: $docker_image_password
> ports:
> - containerPort: $port
> protocol: TCP
> config:
> ALLOW_ANONYMOUS_LOGIN: 'yes'
>
> Even though I've specified the value of ALLOW_ANONYMOUS_LOGIN as the
> string 'yes', it's being converted to a boolean and output as true in
> the container's environment:
>
> "Env": [
> "ALLOW_ANONYMOUS_LOGIN=true",
>
> My container is expecting the string 'yes', not 'true', so this breaks
> it.
>
> This is with 2.5-beta1+develop-db4f51c
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1796202/+subscriptions
>

Revision history for this message
Tim Penhey (thumper) wrote :

I'm wondering if this is a round tripping problem.

We checked that the goyaml library got a string for "yes" and it does.

But if we have a string "yes" and serialise that out, does it get quotes as it should?

Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.5-beta1
assignee: nobody → Ian Booth (wallyworld)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Ian Booth (wallyworld) wrote :
Ian Booth (wallyworld)
Changed in juju:
status: In Progress → Fix Committed
tags: added: cdo-qa
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.