Skip to content

fly set-pipeline shows unneccessary diffs for large numbers #1952

Closed

Description

@JohannesRudolph

Bug Report

The fly cli incorrectly renders diffs for large numbers when invoking fly set-pipeline, even though the numbers didn't change in the pipeline .yml definition.

For example, this yaml:

        params:
          delete_after: 2592000

renders this diff:

        params:
          delete_after: 2.592e+06
          delete_after: 2592000
  • Concourse version: 3.8

Activity

  1. changed the title [-]Fly CLI diffs for large numbers[/-] [+]fly set-pipeline shows unneccessary diffs for large numbers[/+] on Jan 11, 2018
  2. petergtz commented on Jun 12, 2018

    @petergtz

    This is a duplicate of #1407.

  3. edtan commented on Jul 27, 2018

    @edtan
    Contributor

    I thought I'd share some of my notes on this while trying to debug through this. Note that this was tested against master. It seems like the threshold that changes the number to a float is now a uint64. For example:

    jobs:
    - name: Test Large Numbers
      plan:
      - task: Echo Large Number
        config:
          platform: linux
          image_resource:
            type: docker-image
            source: { repository: alpine, tag: latest }
          params:
            LARGE_NUM: 18446744073709551616 # 2^64 + 1
          run:
            path: sh
            args:
              - -exc
              - echo ${LARGE_NUM}
    

    renders this diff:

    params:
      LARGE_NUM: "18446744073709551615"
      LARGE_NUM: "1.8446744e+19"
    

    As the new config is being parsed in atc_config.h within resolveTemplates(), tpl.Evaluate() is called. (tpl is a Template from the bosh-cli project.) These lines in tpl.Evaluate() seem to make the LARGE_NUM to be treated like a float:

    var obj interface{}                                                  
    err := yaml.Unmarshal(t.bytes, &obj)
    

    I could not reproduce this issue for numbers smaller than 2^64 as in the original example.

  4. drahnr commented on Jan 26, 2019

    @drahnr
    Contributor

    Still existing in current 4.2.2

    -     max_n_bytes: 2.5e+08
    +     max_n_bytes: 250000000
    
  5. marco-m commented on Mar 19, 2019

    @marco-m
    Contributor

    As already mentioned, this is a duplicate of #1407 and should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions