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

Bake: empty block should equal null, not empty string #2529

Open
3 tasks done
dvdksn opened this issue Jun 17, 2024 · 0 comments · May be fixed by #2530
Open
3 tasks done

Bake: empty block should equal null, not empty string #2529

dvdksn opened this issue Jun 17, 2024 · 0 comments · May be fixed by #2530
Assignees
Labels
area/bake bake-ga kind/bug Something isn't working
Milestone

Comments

@dvdksn
Copy link
Contributor

dvdksn commented Jun 17, 2024

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

with variable "FOO" {}, I think that FOO should evaluate to null, not an empty string.

Expected behaviour

variable "foo" {}

target "default" {
  args = {
    isNull = equal(foo, null)
    isEmptyString = equal(foo, "")
  }
}
$ bake --print
{
  "target": {
    "default": {
      "context": ".",
      "dockerfile": "Dockerfile",
      "args": {
        "isEmptyString": "false",
        "isNull": "true"
      }
    }
  }
}

Actual behaviour

variable "foo" {}

target "default" {
  args = {
    isNull = equal(foo, null)
    isEmptyString = equal(foo, "")
  }
}
$ bake --print
{
  "target": {
    "default": {
      "context": ".",
      "dockerfile": "Dockerfile",
      "args": {
        "isEmptyString": "true",
        "isNull": "false"
      }
    }
  }
}

Buildx version

github.com/docker/buildx 3b25e3f 3b25e3f

Docker info

No response

Builders list

[david:~/src/s/playground] $ buildx ls
NAME/NODE              DRIVER/ENDPOINT     STATUS    BUILDKIT   PLATFORMS
container*             docker-container                         
 \_ container0          \_ desktop-linux   running   064e35a    linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
default                docker                                   
 \_ default             \_ default         running   v0.13.2    linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
desktop-linux          docker                                   
 \_ desktop-linux       \_ desktop-linux   running   v0.13.2    linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
cloud-docker-default   cloud               error                

Cannot load builder cloud-docker-default: failed to find driver "cloud"

Configuration

variable "foo" {}

target "default" {
  args = {
    isNull = equal(foo, null)
    isEmptyString = equal(foo, "")
  }
}

Build logs

No response

Additional info

No response

@crazy-max crazy-max added kind/enhancement New feature or request area/bake kind/bug Something isn't working and removed status/triage kind/enhancement New feature or request labels Jun 17, 2024
@crazy-max crazy-max linked a pull request Jun 17, 2024 that will close this issue
@thompson-shaun thompson-shaun added this to the v0.16.0 milestone Jun 17, 2024
@crazy-max crazy-max self-assigned this Jun 25, 2024
@thompson-shaun thompson-shaun modified the milestones: v0.16.0, bake-ga Jul 1, 2024
@thompson-shaun thompson-shaun modified the milestones: bake-ga, v0.future Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bake bake-ga kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants