-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: add `Validate()` and `Check()` Signed-off-by: zyy17 <[email protected]> * test: add unit test for Validate() --------- Signed-off-by: zyy17 <[email protected]>
- Loading branch information
Showing
19 changed files
with
534 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
apis/v1alpha1/testdata/validation/greptimedbcluster/test00/input.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: greptime.io/v1alpha1 | ||
kind: GreptimeDBCluster | ||
metadata: | ||
name: test00 | ||
namespace: default | ||
spec: | ||
base: | ||
main: | ||
image: greptime/greptimedb:latest | ||
frontend: | ||
replicas: 1 | ||
meta: | ||
etcdEndpoints: | ||
- etcd.etcd-cluster.svc.cluster.local:2379 | ||
replicas: 1 | ||
datanode: | ||
replicas: 3 |
20 changes: 20 additions & 0 deletions
20
apis/v1alpha1/testdata/validation/greptimedbcluster/test01/input.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: greptime.io/v1alpha1 | ||
kind: GreptimeDBCluster | ||
metadata: | ||
name: test01-error | ||
namespace: default | ||
spec: | ||
base: | ||
main: | ||
image: greptime/greptimedb:latest | ||
frontend: | ||
replicas: 1 | ||
# This is an error because the config is not a valid toml config. | ||
config: | | ||
It's not a valid toml config---- | ||
meta: | ||
etcdEndpoints: | ||
- etcd.etcd-cluster.svc.cluster.local:2379 | ||
replicas: 1 | ||
datanode: | ||
replicas: 3 |
23 changes: 23 additions & 0 deletions
23
apis/v1alpha1/testdata/validation/greptimedbcluster/test02/input.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: greptime.io/v1alpha1 | ||
kind: GreptimeDBCluster | ||
metadata: | ||
name: test02-error | ||
namespace: default | ||
spec: | ||
base: | ||
main: | ||
image: greptime/greptimedb:latest | ||
frontend: | ||
replicas: 1 | ||
meta: | ||
etcdEndpoints: | ||
- etcd.etcd-cluster.svc.cluster.local:2379 | ||
replicas: 1 | ||
datanode: | ||
replicas: 3 | ||
# This is an error because multiple objectStorage configs are not allowed. | ||
objectStorage: | ||
s3: | ||
bucket: "greptimedb" | ||
oss: | ||
bucket: "greptimedb" |
28 changes: 28 additions & 0 deletions
28
apis/v1alpha1/testdata/validation/greptimedbcluster/test03/input.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: greptime.io/v1alpha1 | ||
kind: GreptimeDBCluster | ||
metadata: | ||
name: test03-error | ||
namespace: default | ||
spec: | ||
base: | ||
main: | ||
image: greptime/greptimedb:latest | ||
frontend: | ||
replicas: 1 | ||
meta: | ||
etcdEndpoints: | ||
- etcd.etcd-cluster.svc.cluster.local:2379 | ||
replicas: 1 | ||
datanode: | ||
replicas: 3 | ||
wal: | ||
# This is an error because multiple wal configs are not allowed. | ||
raftEngine: | ||
fs: | ||
storageClassName: io2 # Use io2 storage class for WAL for better performance. | ||
name: wal | ||
storageSize: 5Gi | ||
mountPath: /wal | ||
kafka: | ||
brokerEndpoints: | ||
- "kafka-bootstrap.kafka.svc.cluster.local:9092" |
9 changes: 9 additions & 0 deletions
9
apis/v1alpha1/testdata/validation/greptimedbstandalone/test00/input.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: greptime.io/v1alpha1 | ||
kind: GreptimeDBStandalone | ||
metadata: | ||
name: test00 | ||
namespace: default | ||
spec: | ||
base: | ||
main: | ||
image: greptime/greptimedb:latest |
12 changes: 12 additions & 0 deletions
12
apis/v1alpha1/testdata/validation/greptimedbstandalone/test01/input.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: greptime.io/v1alpha1 | ||
kind: GreptimeDBStandalone | ||
metadata: | ||
name: test00-error | ||
namespace: default | ||
spec: | ||
base: | ||
main: | ||
image: greptime/greptimedb:latest | ||
# This is an error because the config is not a valid toml config. | ||
config: | | ||
It's not a valid toml config---- |
Oops, something went wrong.