Skip to content

Commit 0e1f0ad

Browse files
authored
chore(ec): update schemas to support new custom domain config (#198)
* chore: update schemas * f
1 parent 1cb8c4e commit 0e1f0ad

19 files changed

+446
-51
lines changed

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,12 @@ debug-build:
6767
.PHONY: debug
6868
debug: debug-build
6969
dlv --listen=:2345 --headless=true --api-version=2 exec ./bin/kots-lint-debug
70+
71+
.PHONY: schemas
72+
schemas:
73+
./scripts/schemas.sh
74+
75+
.PHONY: schemas-kubernetes
76+
schemas-kubernetes: VERSION=v1.31.4
77+
schemas-kubernetes:
78+
./scripts/schemas-kubernetes.sh $(VERSION)

README.md

+11-17
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,21 @@ $ make test
5858

5959
## Updating specs
6060

61-
Generated specs can be copied from the source project directly.
62-
File names should match, but since projects will change independently, care should be taken when copying.
61+
The `make schemas` command can be used to automatically update all Replicated schemas:
6362

64-
### Troubleshoot
65-
66-
```
67-
cp <troubleshoot root>/schemas/*.json <kots-lint root>/kubernetes_json_schema/schema/troubleshoot/
63+
```shell
64+
$ make schemas
6865
```
6966

70-
### KOTS
71-
72-
```
73-
cp <kots root>/kotskinds/schemas/*.json <kots-lint root>/kubernetes_json_schema/schema/kots/
74-
```
67+
This will update schemas for:
68+
- KOTS (github.com/replicatedhq/kotskinds)
69+
- Troubleshoot (github.com/replicatedhq/troubleshoot)
70+
- Embedded Cluster (github.com/replicatedhq/embedded-cluster)
7571

76-
### Kubernetes
72+
## Updating Kubernetes specs
7773

78-
```
79-
git clone [email protected]:yannh/kubernetes-json-schema.git
80-
cp <kubernetes-json-schema>/<desired-version>-standalone-strict/*.json <kots-lint root>/kubernetes_json_schema/schema/<desired-version>-standalone-strict/
81-
rm -rf <kots-lint root>/kubernetes_json_schema/schema/<previous-version>-standalone-strict/
74+
```shell
75+
make schemas-kubernetes
8276
```
8377

84-
Finally, update the `KUBERNETES_LINT_VERSION` constant in the `kubernetes_json_schema/schema.go` file.
78+
This will update the schemas for the Kubernetes VERSION specified in the Makefile.

kubernetes_json_schema/schema/embeddedcluster/config-embeddedcluster-v1beta1.json

+37-7
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,31 @@
1717
"description": "ConfigSpec defines the desired state of Config",
1818
"type": "object",
1919
"properties": {
20+
"binaryOverrideUrl": {
21+
"type": "string"
22+
},
23+
"domains": {
24+
"type": "object",
25+
"properties": {
26+
"proxyRegistryDomain": {
27+
"type": "string"
28+
},
29+
"replicatedAppDomain": {
30+
"type": "string"
31+
},
32+
"replicatedRegistryDomain": {
33+
"type": "string"
34+
}
35+
}
36+
},
2037
"extensions": {
2138
"type": "object",
2239
"properties": {
2340
"helm": {
24-
"description": "HelmExtensions specifies settings for cluster helm based extensions",
41+
"description": "Helm contains helm extension settings",
2542
"type": "object",
2643
"properties": {
2744
"charts": {
28-
"description": "ChartsSettings charts settings",
2945
"type": "array",
3046
"items": {
3147
"description": "Chart single helm addon",
@@ -34,6 +50,10 @@
3450
"chartname": {
3551
"type": "string"
3652
},
53+
"forceUpgrade": {
54+
"description": "ForceUpgrade when set to false, disables the use of the \"--force\" flag when upgrading the the chart (default: true).",
55+
"type": "boolean"
56+
},
3757
"name": {
3858
"type": "string"
3959
},
@@ -44,9 +64,9 @@
4464
"type": "integer"
4565
},
4666
"timeout": {
47-
"description": "A Duration represents the elapsed time between two instants\nas an int64 nanosecond count. The representation limits the\nlargest representable duration to approximately 290 years.",
48-
"type": "integer",
49-
"format": "int64"
67+
"description": "Timeout specifies the timeout for how long to wait for the chart installation to finish.\nA duration string is a sequence of decimal numbers, each with optional fraction and a unit suffix, such as \"300ms\" or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".",
68+
"type": "string",
69+
"x-kubernetes-int-or-string": true
5070
},
5171
"values": {
5272
"type": "string"
@@ -61,34 +81,41 @@
6181
"type": "integer"
6282
},
6383
"repositories": {
64-
"description": "RepositoriesSettings repository settings",
6584
"type": "array",
6685
"items": {
6786
"description": "Repository describes single repository entry. Fields map to the CLI flags for the \"helm add\" command",
6887
"type": "object",
6988
"properties": {
7089
"caFile": {
90+
"description": "CA bundle file to use when verifying HTTPS-enabled servers.",
7191
"type": "string"
7292
},
7393
"certFile": {
94+
"description": "The TLS certificate file to use for HTTPS client authentication.",
7495
"type": "string"
7596
},
7697
"insecure": {
98+
"description": "Whether to skip TLS certificate checks when connecting to the repository.",
7799
"type": "boolean"
78100
},
79101
"keyfile": {
102+
"description": "The TLS key file to use for HTTPS client authentication.",
80103
"type": "string"
81104
},
82105
"name": {
106+
"description": "The repository name.",
83107
"type": "string"
84108
},
85109
"password": {
110+
"description": "Password for Basic HTTP authentication.",
86111
"type": "string"
87112
},
88113
"url": {
114+
"description": "The repository URL.",
89115
"type": "string"
90116
},
91117
"username": {
118+
"description": "Username for Basic HTTP authentication.",
92119
"type": "string"
93120
}
94121
}
@@ -98,6 +125,9 @@
98125
}
99126
}
100127
},
128+
"metadataOverrideUrl": {
129+
"type": "string"
130+
},
101131
"roles": {
102132
"description": "Roles is the various roles in the cluster.",
103133
"type": "object",
@@ -239,4 +269,4 @@
239269
"type": "object"
240270
}
241271
}
242-
}
272+
}

kubernetes_json_schema/schema/kots/airgap-kots-v1beta1.json

+23-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"type": "object",
44
"properties": {
55
"apiVersion": {
6-
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
6+
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
77
"type": "string"
88
},
99
"kind": {
10-
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
10+
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
1111
"type": "string"
1212
},
1313
"metadata": {
@@ -30,6 +30,12 @@
3030
"description": "EmbeddedClusterArtifacts maps embedded cluster artifacts to their path",
3131
"type": "object",
3232
"properties": {
33+
"additionalArtifacts": {
34+
"type": "object",
35+
"additionalProperties": {
36+
"type": "string"
37+
}
38+
},
3339
"binaryAmd64": {
3440
"type": "string"
3541
},
@@ -41,6 +47,21 @@
4147
},
4248
"metadata": {
4349
"type": "string"
50+
},
51+
"registry": {
52+
"description": "EmbeddedClusterRegistry holds a directory from where a images can be read and later\npushed to the embedded cluster registry. Format inside the directory is the same as\nthe registry storage format.",
53+
"type": "object",
54+
"properties": {
55+
"dir": {
56+
"type": "string"
57+
},
58+
"savedImages": {
59+
"type": "array",
60+
"items": {
61+
"type": "string"
62+
}
63+
}
64+
}
4465
}
4566
}
4667
},

kubernetes_json_schema/schema/kots/application-kots-v1beta1.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"type": "object",
44
"properties": {
55
"apiVersion": {
6-
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
6+
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
77
"type": "string"
88
},
99
"kind": {
10-
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
10+
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
1111
"type": "string"
1212
},
1313
"metadata": {

kubernetes_json_schema/schema/kots/config-kots-v1beta1.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"type": "object",
44
"properties": {
55
"apiVersion": {
6-
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
6+
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
77
"type": "string"
88
},
99
"kind": {
10-
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
10+
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
1111
"type": "string"
1212
},
1313
"metadata": {

kubernetes_json_schema/schema/kots/configvalues-kots-v1beta1.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"type": "object",
44
"properties": {
55
"apiVersion": {
6-
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
6+
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
77
"type": "string"
88
},
99
"kind": {
10-
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
10+
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
1111
"type": "string"
1212
},
1313
"metadata": {

kubernetes_json_schema/schema/kots/helmchart-kots-v1beta1.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"type": "object",
44
"properties": {
55
"apiVersion": {
6-
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
6+
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
77
"type": "string"
88
},
99
"kind": {
10-
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
10+
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
1111
"type": "string"
1212
},
1313
"metadata": {

kubernetes_json_schema/schema/kots/helmchart-kots-v1beta2.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"type": "object",
44
"properties": {
55
"apiVersion": {
6-
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
6+
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
77
"type": "string"
88
},
99
"kind": {
10-
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
10+
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
1111
"type": "string"
1212
},
1313
"metadata": {

kubernetes_json_schema/schema/kots/identity-kots-v1beta1.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"type": "object",
44
"properties": {
55
"apiVersion": {
6-
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
6+
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
77
"type": "string"
88
},
99
"kind": {
10-
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
10+
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
1111
"type": "string"
1212
},
1313
"metadata": {

0 commit comments

Comments
 (0)