Ensure the operator detects that it supports the amd64 architecture
We have seen the operator spew errors of the type
{
"level": "error",
"ts": "2024-08-05T08:08:18Z",
"msg": "Reconciler error",
"controller": "cluster",
"controllerGroup": "postgresql.cnpg.io",
"controllerKind": "Cluster",
"Cluster": {
"name": "pgcluster-example",
"namespace": "pgcluster-test"
},
"namespace": "pgcluster-test",
"name": "pgcluster-example",
"reconcileID": "445640b8-7aca-4875-9452-e0c3993ab7d6",
"error": "cannot update the resource status: invalid architecture: amd64",
"stacktrace": "..."
}
After a bit of digging in the opertor code, I found the /manager debug show-architectures
command.
When running it in the official cloudnative-pg
image, we see the following:
~ ❯ docker run --rm -it 5aaf1300ccd5 debug show-architectures
[
"amd64",
"arm64"
]
However, when running this command in the image we built, we see an empty list:
~ ❯ docker run --rm -it docker-registry.wikimedia.org/repos/data-engineering/postgresql-kubernetes/cloudnative-pg:1.23.1 debug show-architectures
[]
I read the operator code, and found this section,
that showed that the supported archiitectures are detected at runtime, by looking at the suffixes
the /bin/manager_*
symmlinks, all pointing to /manager
.
I inspected both images using dive
, and indeed, our image didn't
have any symlink named /bin/manager_amd64
pointing to /manager
.
(Our image is in the top pane, and the official image in the bottom one)
Bug: T364797