#3888·opencost

opencost:1.120.4 image ships a 1.120.3 binary

Author: 0raxCreated Jun 30, 2026Updated Aug 26, 2026

Describe the bug

The container images published for the v1.120.4 release (ghcr.io/opencost/opencost:1.120.4 and :latest, (sha256:5467eaac8d301be69cc4a3f69f063ad5da7d57130d1126a4eb75b0d8f79839e1)) do not contain the code from the v1.120.4 git tag. The embedded binary was built from commit 85c87a3 (dated 2026-05-28), which predates several commits merged into the v1.120.4 tag.

I wanted to test the changes made in #3853 (merged 2026-06-17) and couldn't make it work as the service was still crashing with:

INF Found ProviderID starting with "gce", using GCP Provider
panic: Supply a GCP Key to start getting data

goroutine 1 [running]:
github.com/opencost/opencost/pkg/costmodel.Initialize(...)
    /home/runner/work/opencost/opencost/pkg/costmodel/router.go:451
...

Which shouldn't be possible if the WI changes were present.

This was discovered by extracting the buildinfo data from the OpenCost binary inside the image (under /go/bin/app):

        path    github.com/opencost/opencost/cmd/costmodel
        mod     github.com/opencost/opencost    v1.120.3+dirty
        dep     github.com/jmespath/go-jmespath v0.4.0  h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
        build   -buildmode=exe
        build   -compiler=gc
        build   -ldflags="-X github.com/opencost/opencost/core/pkg/version.Version=1.120.4 -X github.com/opencost/opencost/core/pkg/version.GitCommit=85c87a3"
        build   CGO_ENABLED=0
        build   GOARCH=amd64
        build   GOOS=linux
        build   GOAMD64=v1
        build   vcs=git
        build   vcs.revision=85c87a3f3fcc242efad69b5f3bcd42a3ae0205da
        build   vcs.time=2026-05-28T14:48:31Z
        build   vcs.modified=true

This specific revision is 18 commits behind the v1.120.4 tag and coincides with v1.120.3.

Using strings on the same binary, I was also able to confirm that the Supply a GCP Key to start getting data string was still part of the binary. Confirming that some of the latest changes did not get built.

To Reproduce

bash
crane export --platform linux/amd64 ghcr.io/opencost/opencost:1.120.4 opencost.tar
mkdir opencost
tar -C opencost -xf opencost.tar
go version -m opencost/go/bin/app | grep -E '(mod|path|build)[[:space:]]'
strings opencost/go/bin/app | grep "Supply a GCP Key to start getting data"

Expected behavior

The v1.120.4 (and latest) images should be built from the v1.120.4 tag (1741baa).

Which version of OpenCost are you using?

  • Image: ghcr.io/opencost/opencost:1.120.4
  • Helm chart: oci://ghcr.io/opencost/charts:2.5.25