Skip to content

Commit cd350a4

Browse files
authored
make run.sh executable from within e2e (#619)
1 parent 1d45a6a commit cd350a4

20 files changed

+169
-61
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ before_install:
1515
- go get github.com/mattn/goveralls
1616

1717
install:
18-
- make deps e2e-tools e2e-build
18+
- make deps
1919

2020
script:
2121
- hack/verify-codegen.sh
2222
- travis_wait 20 goveralls -service=travis-ci -package ./pkg/... -v
23-
- make e2e-run
23+
- make e2e

Makefile

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: clean local test linux macos docker push scm-source.json e2e-run e2e-tools e2e-build
1+
.PHONY: clean local test linux macos docker push scm-source.json e2e
22

33
BINARY ?= postgres-operator
44
BUILD_FLAGS ?= -v
@@ -34,7 +34,10 @@ ifdef CDP_PULL_REQUEST_NUMBER
3434
CDP_TAG := -${CDP_BUILD_VERSION}
3535
endif
3636

37-
KIND_PATH := $(GOPATH)/bin
37+
ifndef GOPATH
38+
GOPATH := $(HOME)/go
39+
endif
40+
3841
PATH := $(GOPATH)/bin:$(PATH)
3942
SHELL := env PATH=$(PATH) $(SHELL)
4043

@@ -92,15 +95,5 @@ test:
9295
hack/verify-codegen.sh
9396
@go test ./...
9497

95-
e2e-build:
96-
docker build --tag="postgres-operator-e2e-tests" -f e2e/Dockerfile .
97-
98-
e2e-tools:
99-
# install pinned version of 'kind'
100-
# leave the name as is to avoid overwriting official binary named `kind`
101-
wget https://github.com/kubernetes-sigs/kind/releases/download/v0.3.0/kind-linux-amd64
102-
chmod +x kind-linux-amd64
103-
mv kind-linux-amd64 $(KIND_PATH)
104-
105-
e2e-run: docker
106-
e2e/run.sh
98+
e2e:
99+
cd e2e; make tools test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ There is a browser-friendly version of this documentation at
6464
* [The Postgres experience on K8s](docs/user.md)
6565
* [The Postgres Operator UI](docs/operator-ui.md)
6666
* [DBA options - from RBAC to backup](docs/administrator.md)
67-
* [Debug and extend the operator](docs/developer.md)
67+
* [Build, debug and extend the operator](docs/developer.md)
6868
* [Configuration options](docs/reference/operator_parameters.md)
6969
* [Postgres manifest reference](docs/reference/cluster_manifest.md)
7070
* [Command-line options and environment variables](docs/reference/command_line_and_environment.md)

delivery.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pipeline:
4444
- desc: 'Run e2e tests'
4545
cmd: |
4646
cd $OPERATOR_TOP_DIR/postgres-operator
47-
make e2e-tools e2e-build e2e-run
47+
make e2e
4848
- desc: 'Push docker image'
4949
cmd: |
5050
export PATH=$PATH:$HOME/go/bin

docs/administrator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ on `configmaps` resources). This is also done intentionally to avoid breaking
9898
things if someone decides to configure the same service account in the
9999
operator's ConfigMap to run Postgres clusters.
100100

101-
### Give K8S users access to create/list `postgresqls`
101+
### Give K8s users access to create/list `postgresqls`
102102

103103
By default `postgresql` custom resources can only be listed and changed by
104104
cluster admins. To allow read and/or write access to other human users apply
@@ -363,7 +363,7 @@ used internally in K8s.
363363

364364
## Logical backups
365365

366-
The operator can manage k8s cron jobs to run logical backups of Postgres
366+
The operator can manage K8s cron jobs to run logical backups of Postgres
367367
clusters. The cron job periodically spawns a batch job that runs a single pod.
368368
The backup script within this pod's container can connect to a DB for a logical
369369
backup. The operator updates cron jobs during Sync if the job schedule changes;

docs/developer.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ kubectl get pod -l name=postgres-operator
9696
The operator employs K8s-provided code generation to obtain deep copy methods
9797
and K8s-like APIs for its custom resource definitions, namely the
9898
Postgres CRD and the operator CRD. The usage of the code generation follows
99-
conventions from the k8s community. Relevant scripts live in the `hack`
99+
conventions from the K8s community. Relevant scripts live in the `hack`
100100
directory:
101101
* `update-codegen.sh` triggers code generation for the APIs defined in `pkg/apis/acid.zalan.do/`,
102102
* `verify-codegen.sh` checks if the generated code is up-to-date (to be used within CI).
@@ -247,23 +247,20 @@ kubectl logs acid-minimal-cluster-0
247247

248248
## End-to-end tests
249249

250-
The operator provides reference e2e (end-to-end) tests to ensure various infra
251-
parts work smoothly together. Each e2e execution tests a Postgres Operator image
252-
built from the current git branch. The test runner starts a [kind](https://kind.sigs.k8s.io/)
253-
(local k8s) cluster and Docker container with tests. The k8s API client from
254-
within the container connects to the `kind` cluster using the standard Docker
255-
`bridge` network. The tests utilize examples from `/manifests` (ConfigMap is
256-
used for the operator configuration) to avoid maintaining yet another set of
257-
configuration files. The kind cluster is deleted if tests complete successfully.
250+
The operator provides reference end-to-end tests (e2e) (as Docker image) to
251+
ensure various infrastructure parts work smoothly together. Each e2e execution
252+
tests a Postgres Operator image built from the current git branch. The test
253+
runner creates a new local K8s cluster using [kind](https://kind.sigs.k8s.io/),
254+
utilizes provided manifest examples, and runs e2e tests contained in the `tests`
255+
folder. The K8s API client in the container connects to the `kind` cluster via
256+
the standard Docker `bridge` network. The kind cluster is deleted if tests
257+
finish successfully or on each new run in case it still exists.
258258

259-
End-to-end tests are executed automatically during builds:
259+
End-to-end tests are executed automatically during builds (for more details,
260+
see the [README](../e2e/README.md) in the `e2e` folder):
260261

261262
```bash
262-
# invoke them from the project's top directory
263-
make e2e-run
264-
265-
# install kind and build test image before first run
266-
make e2e-tools e2e-build
263+
make e2e
267264
```
268265

269266
End-to-end tests are written in Python and use `flake8` for code quality.

docs/diagrams/pod.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
node[k8s-label] (app-label) {App}
3939
node[k8s-label, right=.25cm of app-label] (role-label) {Role}
4040
node[k8s-label, right=.25cm of role-label] (custom-label) {Custom}
41-
node[label, below of=role-label] (k8s-label-label) {K8S Labels}
41+
node[label, below of=role-label] (k8s-label-label) {K8s Labels}
4242
node[border, behind path,
4343
fit=(app-label)(role-label)(custom-label)(k8s-label-label)
4444
] (k8s-labels) {}; \& \&

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ used to complement it.
4646
Here is a diagram, that summarizes what would be created by the operator, when a
4747
new Postgres cluster CRD is submitted:
4848

49-
![postgresql-operator](diagrams/operator.png "K8S resources, created by operator")
49+
![postgresql-operator](diagrams/operator.png "K8s resources, created by operator")
5050

5151
This picture is not complete without an overview of what is inside a single
5252
cluster pod, so let's zoom in:

docs/reference/cluster_manifest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ These parameters are grouped directly under the `spec` key in the manifest.
135135
to S3. Default: false. Optional.
136136

137137
* **logicalBackupSchedule**
138-
Schedule for the logical backup k8s cron job. Please take
138+
Schedule for the logical backup K8s cron job. Please take
139139
[the reference schedule format](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#schedule)
140140
into account. Optional. Default is: "30 00 \* \* \*"
141141

docs/reference/operator_parameters.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ configuration they are grouped under the `kubernetes` key.
158158

159159
* **pod_service_account_role_binding_definition**
160160
This definition must bind pod service account to a role with permission
161-
sufficient for the pods to start and for Patroni to access k8s endpoints;
162-
service account on its own lacks any such rights starting with k8s v1.8. If
161+
sufficient for the pods to start and for Patroni to access K8s endpoints;
162+
service account on its own lacks any such rights starting with K8s v1.8. If
163163
not explicitly defined by the user, a simple definition that binds the
164164
account to the operator's own 'zalando-postgres-operator' cluster role will
165165
be used. The default is empty.
@@ -416,7 +416,7 @@ yet officially supported.
416416

417417
## Logical backup
418418

419-
These parameters configure a k8s cron job managed by the operator to produce
419+
These parameters configure a K8s cron job managed by the operator to produce
420420
Postgres logical backups. In the CRD-based configuration those parameters are
421421
grouped under the `logical_backup` key.
422422

0 commit comments

Comments
 (0)