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: resource_docker_service tmpfs mounts #563 #570

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 7, 2023

  1. fix: resource_docker_service tmpfs mounts kreuzwerker#563

    terraform schemas can only work with int type which is either int32 or
    int64 equivalent depending on architecture, but the Docker lib expects
    an int64 for the size_bytes. Previously, the code assumed that the
    terraform schema would return an int64, which lead to provider crashes.
    
    values are now being converted between int64 and int to handle this. The
    downside is possible value truncation: resources managed by Terraform
    can't have tmpfs size_bytes greater than just under 2 GiB (2147483647
    byes by golang spec), which can lead to false information if the
    physical service has been modified to a tmfs size_bytes greater than
    that outside of terraform, because the int64->int conversion will
    possibly truncate that on go implementations where int is equivalent to
    int32.
    
    As long as the limitiation of only TypeInt being available in the schema
    (and not e.g. TypeInt64) there will be no clean solution to this. An
    improvement could be to switch to either TypeFloat (53 bits of accuracy,
    still with the issue, but much less likely to impact in real life, it's
    8TiB) or TypeString and convert the numbers between string
    representations. Both options exceed my Go capabilities though, I think.
    JanKoppe committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    5945a4f View commit details
    Browse the repository at this point in the history