Skip to content

Fix: use abspath glob patterns to detect architecture support

Brouberol requested to merge T364797-amd64-support into main

The original dockerfile performs the following operations:

WORKDIR /
...
RUN ln -sf /bin/manager_${TARGETARCH} manager

and the architecture detection assumes that it's running under / when running


// DetectAvailableArchitectures detects the architectures available in the cluster
func DetectAvailableArchitectures() error {
	return detectAvailableArchitectures("bin/manager_*")
}

As such, we see the difference with and without the WORDIR /:

~/code/cloudnative-pg #v1.23.3 ❯ docker run --rm -it 12eb698cdaa3 debug show-architectures
[]
~/code/cloudnative-pg #v1.23.3 ❯ docker run --rm -it -w / 12eb698cdaa3 debug show-architectures
[
    "amd64"
]

Bug: T364797

Edited by Brouberol

Merge request reports