Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for numeric types #2557

Merged
merged 1 commit into from
Feb 6, 2023

Commits on Feb 6, 2023

  1. Fix support for numeric types

    When I updated the canonical json library used by cnab-go, I missed that cnab-to-oci also used the one without support for numeric types. I have updated Porter with a regression test for numeric types (just building a bundle with it isn't enough, we need to push it too which exercises the fix in cnab-to-oci). For now we'll stay on a patched cnab-to-oci until the patch is merged and a new release of cnab-to-oci is available.
    
    This fixes the following error when pushing a bundle that uses numeric types, such as setting the default value for a paramter to 0.5
    
    ```
    $ porter publish
    reference not found (localhost:5000/porter-hello:v0.1.0)
    Pushing bundle image...
    The push refers to repository [localhost:5000/porter-hello]
    ...
    0fd880641d89: Pushed
    9d0460f30cfd: Pushed
    76dda007b025: Pushed
    porter-37da5464f8517662657529ad34851db9: digest: sha256:d53641f601988f8894ebc681bcb277624db45e328f547054401d2de994e2ab1e size: 2412
    
    Rewriting CNAB bundle.json...
    Starting to copy image localhost:5000/porter-hello@sha256:d53641f601988f8894ebc681bcb277624db45e328f547054401d2de994e2ab1e...
    Completed image localhost:5000/porter-hello@sha256:d53641f601988f8894ebc681bcb277624db45e328f547054401d2de994e2ab1e copy
    error pushing the bundle to localhost:5000/porter-hello:v0.1.0: json: unsupported value: 0.5
    ```
    
    Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
    carolynvs committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    7a14257 View commit details
    Browse the repository at this point in the history