Skip to content

Commit 562a565

Browse files
committed
Adding postgres analyzer
1 parent f37bbdb commit 562a565

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3109
-119
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ vet:
6767

6868
.PHONY: generate
6969
generate: controller-gen client-gen
70-
controller-gen object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
71-
client-gen --output-package=github.com/replicatedhq/troubleshoot/pkg/client --clientset-name troubleshootclientset --input-base github.com/replicatedhq/troubleshoot/pkg/apis --input troubleshoot/v1beta1 -h ./hack/boilerplate.go.txt
70+
$(shell go env GOPATH)/bin/controller-gen object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
71+
$(shell go env GOPATH)/bin/client-gen --output-package=github.com/replicatedhq/troubleshoot/pkg/client --clientset-name troubleshootclientset --input-base github.com/replicatedhq/troubleshoot/pkg/apis --input troubleshoot/v1beta1 -h ./hack/boilerplate.go.txt
7272

7373
.PHONY: openapischema
7474
openapischema: controller-gen

examples/preflight/postgres.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: troubleshoot.replicated.com/v1beta1
2+
kind: Preflight
3+
metadata:
4+
name: sample
5+
spec:
6+
collectors:
7+
- postgres:
8+
collectorName: pg
9+
uri: postgres://testuser:password@postgresql:5432/testdb?sslmode=disable
10+
analyzers:
11+
- postgres:
12+
checkName: Must be postgres 10.x or later
13+
collectorName: pg
14+
outcomes:
15+
- fail:
16+
when: "connected == false"
17+
message: Cannot connect to postgres server
18+
- fail:
19+
when: "version < 10.x"
20+
message: The postgres server must be at least version 10
21+
- pass:
22+
message: The postgres connection checks out
23+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: troubleshoot.replicated.com/v1beta1
2+
kind: Preflight
3+
metadata:
4+
name: example-preflight-checks
5+
spec:
6+
collectors:
7+
- data:
8+
name: config/replicas.txt
9+
data: "2"
10+
analyzers:
11+
- textAnalyze:
12+
checkName: Replica Count
13+
fileName: config/replicas.txt
14+
regexGroups: '(?P<Replicas>\d+)'
15+
outcomes:
16+
- fail:
17+
when: "Replicas < 5"
18+
message: That's not enough replicas!
19+
- pass:
20+
message: You've selected at leat 5 replicas

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/clientset.go

Lines changed: 96 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/doc.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/fake/clientset_generated.go

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/fake/doc.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/fake/register.go

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme/doc.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)