Skip to content

Commit 3748567

Browse files
committed
Merge branch 'master' of github.com:replicatedhq/troubleshoot
2 parents d754b3b + 225ebfb commit 3748567

24 files changed

+998
-118
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,13 @@ 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 \
72+
--output-package=github.com/replicatedhq/troubleshoot/pkg/client \
73+
--clientset-name troubleshootclientset \
74+
--input-base github.com/replicatedhq/troubleshoot/pkg/apis \
75+
--input troubleshoot/v1beta1 \
76+
-h ./hack/boilerplate.go.txt
7277

7378
.PHONY: openapischema
7479
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: postgresql://user:password@hostname:5432/defaultdb?sslmode=require
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+

examples/preflight/redis.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+
- redis:
8+
collectorName: my-redis
9+
uri: rediss://default:password@hostname:6379
10+
analyzers:
11+
- redis:
12+
checkName: Must be redis 5.x or later
13+
collectorName: my-redis
14+
outcomes:
15+
- fail:
16+
when: "connected == false"
17+
message: Cannot connect to postgres server
18+
- fail:
19+
when: "version < 5.0.0"
20+
message: The redis server must be at least version 5
21+
- pass:
22+
message: The redis 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

go.mod

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ require (
1616
github.com/gin-gonic/gin v1.4.0
1717
github.com/gizak/termui/v3 v3.1.0
1818
github.com/go-openapi/spec v0.19.4 // indirect
19+
github.com/go-openapi/validate v0.19.5 // indirect
20+
github.com/go-redis/redis/v7 v7.2.0
21+
github.com/go-sql-driver/mysql v1.5.0
1922
github.com/golang/snappy v0.0.1 // indirect
2023
github.com/google/gofuzz v1.1.0
2124
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
2225
github.com/hashicorp/go-getter v1.3.1-0.20190627223108-da0323b9545e
2326
github.com/hashicorp/go-multierror v1.0.0
2427
github.com/imdario/mergo v0.3.8 // indirect
28+
github.com/lib/pq v1.3.0
2529
github.com/manifoldco/promptui v0.3.2
2630
github.com/mattn/go-colorable v0.1.4 // indirect
2731
github.com/mattn/go-isatty v0.0.9
@@ -42,18 +46,20 @@ require (
4246
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
4347
go.opencensus.io v0.22.0 // indirect
4448
go.undefinedlabs.com/scopeagent v0.1.7
45-
golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72 // indirect
4649
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 // indirect
4750
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 // indirect
4851
golang.org/x/tools v0.0.0-20191010075000-0337d82405ff // indirect
4952
gopkg.in/alecthomas/kingpin.v3-unstable v3.0.0-20191105091915-95d230a53780 // indirect
5053
gopkg.in/yaml.v2 v2.2.8
51-
k8s.io/api v0.17.2
52-
k8s.io/apiextensions-apiserver v0.17.2
53-
k8s.io/apimachinery v0.17.3
54+
k8s.io/api v0.17.4
55+
k8s.io/apiextensions-apiserver v0.15.12-beta.0
56+
k8s.io/apimachinery v0.17.4
57+
k8s.io/apiserver v0.17.4 // indirect
5458
k8s.io/cli-runtime v0.17.0
55-
k8s.io/client-go v0.17.2
59+
k8s.io/client-go v0.17.4
60+
k8s.io/code-generator v0.16.5-beta.1 // indirect
5661
sigs.k8s.io/controller-runtime v0.4.0
62+
sigs.k8s.io/controller-tools v0.2.4 // indirect
5763
)
5864

5965
replace github.com/appscode/jsonpatch => github.com/gomodules/jsonpatch v2.0.1+incompatible

0 commit comments

Comments
 (0)