Skip to content

Commit

Permalink
acceptance: update how we build the python compose image
Browse files Browse the repository at this point in the history
Up until this point we were using `apt install postgresql-client` to
install the `psql` binary in this image. Because the `postgresql-client`
`apt` package was apparently updated to a later version of `postgres`
last week that includes [this change](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=a59c79564bdc209a5bc7b02d706f0d7352eb82fa),
the `TestComposeGSSPython` `acceptance` test started failing with the
following error:

```
psql: error: private key file "/certs/client.root.key" must be owned by the current user or root
```

Less recent versions of `psql` are more permissive about cert
permissions, so we work around this by manually installing postgres 11.

Release note: None
Release justification: Test-only change
  • Loading branch information
rickystewart committed May 17, 2022
1 parent 4216e6e commit ecf90bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions pkg/acceptance/compose/gss/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM python:3
ENV PYTHONUNBUFFERED 1

RUN apt-get update && \
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
krb5-user \
postgresql-client
postgresql-client-11

RUN mkdir /code
WORKDIR /code
Expand Down
2 changes: 0 additions & 2 deletions pkg/acceptance/compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (

"github.com/cockroachdb/cockroach/pkg/acceptance/cluster"
"github.com/cockroachdb/cockroach/pkg/build/bazel"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
)

const composeDir = "compose"
Expand All @@ -30,7 +29,6 @@ func TestComposeGSS(t *testing.T) {
}

func TestComposeGSSPython(t *testing.T) {
skip.WithIssue(t, 81254)
testCompose(t, filepath.Join("gss", "docker-compose-python.yml"), "python")
}

Expand Down

0 comments on commit ecf90bc

Please sign in to comment.