Hey guys, got a quick question, would it be possib...
# general
m
Hey guys, got a quick question, would it be possible to access the tag of the built image in helm_deployment's values? Thanks!
Copy code
docker_image(
    name="image",
    dependencies=[
        "//core/model_operator:bin",
    ],
    source="Dockerfile",
    build_platform=["linux/amd64"],
    image_tags=["latest", "0.1.0"],
)

helm_chart(name="chart", registries=["@dev"])

helm_deployment(
    name="dev",
    chart=":chart",
    sources=None,
    values={
        "tag": ":image#image_tags", would this be possible?
    },
)
I thought it would be possible to compose targets based on the values of other targets
c
I don't think you can reference attributes of targets, but BUILD files are Python, so you can use a variable:
Copy code
my_image_tags = ["latest", "111.222.333"]

docker_image(
    name="image",
    image_tags=my_image_tags,
    ...
)

helm_chart(name="chart")

helm_deployment(
    name="dev",
    chart=":chart",
    values={
    "image.tag": my_image_tags[1]
    },
    ...
)
m
ah, i didn't realise this option. thanks!
f
pretty sure you can, theres a section in the docs here https://www.pantsbuild.org/2.19/docs/helm/deployments#dependencies-with-docker_image-targets the docker target exports the build image info in a json file which the helm target can consume