Skip to content

Release builds do not contain version information #2055

@mdbooth

Description

@mdbooth

/kind bug

i.e.

$ podman run --rm gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:v0.10.1 --version

produces no output.

cloudbuild makes release-staging:

entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- TAG=$_GIT_TAG
- PULL_BASE_REF=$_PULL_BASE_REF
- DOCKER_BUILDKIT=1
args:
- release-staging

which ultimately calls the docker-build make target:

docker-build: ## Build the docker image for controller-manager
docker build -f Dockerfile --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)

Note that it passes --build-arg LDFLAGS="$(LDFLAGS)". The version information is included in the LDFLAGS make variable and passed to docker as a build arg called LDFLAGS. However, the docker build arg is lowercase:

so it is never set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions