diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f94db8e..c96f064c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,10 +12,10 @@ repos: name: Run 'make generate' in all app directories entry: | /bin/bash -c ' - for dir in ./packages/apps/*/; do + for dir in ./packages/apps/*/ ./packages/extra/*/ ./packages/system/cozystack-api/; do if [ -d "$dir" ]; then echo "Running make generate in $dir" - (cd "$dir" && make generate) + make generate -C "$dir" fi done git diff --color=always | cat diff --git a/packages/extra/ingress/README.md b/packages/extra/ingress/README.md index ab4ed3d9..76236118 100644 --- a/packages/extra/ingress/README.md +++ b/packages/extra/ingress/README.md @@ -7,7 +7,6 @@ | Name | Description | Value | | ---------------- | ----------------------------------------------------------------- | ------- | | `replicas` | Number of ingress-nginx replicas | `2` | -| `externalIPs` | List of externalIPs for service. | `[]` | | `whitelist` | List of client networks | `[]` | | `clouflareProxy` | Restoring original visitor IPs when Cloudflare proxied is enabled | `false` | diff --git a/packages/extra/ingress/values.schema.json b/packages/extra/ingress/values.schema.json index c956bac3..d4f7b6c3 100644 --- a/packages/extra/ingress/values.schema.json +++ b/packages/extra/ingress/values.schema.json @@ -7,14 +7,6 @@ "description": "Number of ingress-nginx replicas", "default": 2 }, - "externalIPs": { - "type": "array", - "description": "List of externalIPs for service.", - "default": "[]", - "items": { - "type": "string" - } - }, "whitelist": { "type": "array", "description": "List of client networks", diff --git a/packages/system/cozystack-api/Makefile b/packages/system/cozystack-api/Makefile index 66853833..b06b97be 100644 --- a/packages/system/cozystack-api/Makefile +++ b/packages/system/cozystack-api/Makefile @@ -21,3 +21,8 @@ image-cozystack-api: IMAGE="$(REGISTRY)/cozystack-api:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/cozystack-api.json -o json -r)" \ yq -i '.cozystackAPI.image = strenv(IMAGE)' values.yaml rm -f images/cozystack-api.json + +generate: + rm -rf openapi-schemas + mkdir -p openapi-schemas + find ../../apps ../../extra -maxdepth 2 -name values.schema.json -exec sh -c 'ln -s ../{} openapi-schemas/$$(basename $$(dirname {})).json' \; diff --git a/packages/system/cozystack-api/openapi-schemas/bootbox.json b/packages/system/cozystack-api/openapi-schemas/bootbox.json new file mode 120000 index 00000000..ae362f9e --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/bootbox.json @@ -0,0 +1 @@ +../../../extra/bootbox/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/bucket.json b/packages/system/cozystack-api/openapi-schemas/bucket.json new file mode 120000 index 00000000..3b0a3a83 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/bucket.json @@ -0,0 +1 @@ +../../../apps/bucket/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/clickhouse.json b/packages/system/cozystack-api/openapi-schemas/clickhouse.json new file mode 120000 index 00000000..ff882f52 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/clickhouse.json @@ -0,0 +1 @@ +../../../apps/clickhouse/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/etcd.json b/packages/system/cozystack-api/openapi-schemas/etcd.json new file mode 120000 index 00000000..60885d5a --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/etcd.json @@ -0,0 +1 @@ +../../../extra/etcd/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/ferretdb.json b/packages/system/cozystack-api/openapi-schemas/ferretdb.json new file mode 120000 index 00000000..72b0036e --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/ferretdb.json @@ -0,0 +1 @@ +../../../apps/ferretdb/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/http-cache.json b/packages/system/cozystack-api/openapi-schemas/http-cache.json new file mode 120000 index 00000000..8cbe4391 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/http-cache.json @@ -0,0 +1 @@ +../../../apps/http-cache/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/info.json b/packages/system/cozystack-api/openapi-schemas/info.json new file mode 120000 index 00000000..9e3fe7e3 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/info.json @@ -0,0 +1 @@ +../../../extra/info/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/ingress.json b/packages/system/cozystack-api/openapi-schemas/ingress.json new file mode 120000 index 00000000..3ce2865c --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/ingress.json @@ -0,0 +1 @@ +../../../extra/ingress/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/kafka.json b/packages/system/cozystack-api/openapi-schemas/kafka.json new file mode 120000 index 00000000..f8585e63 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/kafka.json @@ -0,0 +1 @@ +../../../apps/kafka/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/kubernetes.json b/packages/system/cozystack-api/openapi-schemas/kubernetes.json new file mode 120000 index 00000000..a7110239 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/kubernetes.json @@ -0,0 +1 @@ +../../../apps/kubernetes/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/monitoring.json b/packages/system/cozystack-api/openapi-schemas/monitoring.json new file mode 120000 index 00000000..ccf48a27 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/monitoring.json @@ -0,0 +1 @@ +../../../extra/monitoring/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/mysql.json b/packages/system/cozystack-api/openapi-schemas/mysql.json new file mode 120000 index 00000000..b5773dcb --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/mysql.json @@ -0,0 +1 @@ +../../../apps/mysql/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/nats.json b/packages/system/cozystack-api/openapi-schemas/nats.json new file mode 120000 index 00000000..f8f4e11d --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/nats.json @@ -0,0 +1 @@ +../../../apps/nats/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/postgres.json b/packages/system/cozystack-api/openapi-schemas/postgres.json new file mode 120000 index 00000000..828ec547 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/postgres.json @@ -0,0 +1 @@ +../../../apps/postgres/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/rabbitmq.json b/packages/system/cozystack-api/openapi-schemas/rabbitmq.json new file mode 120000 index 00000000..608102f5 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/rabbitmq.json @@ -0,0 +1 @@ +../../../apps/rabbitmq/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/redis.json b/packages/system/cozystack-api/openapi-schemas/redis.json new file mode 120000 index 00000000..f06cc50e --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/redis.json @@ -0,0 +1 @@ +../../../apps/redis/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/seaweedfs.json b/packages/system/cozystack-api/openapi-schemas/seaweedfs.json new file mode 120000 index 00000000..542228ca --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/seaweedfs.json @@ -0,0 +1 @@ +../../../extra/seaweedfs/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/tcp-balancer.json b/packages/system/cozystack-api/openapi-schemas/tcp-balancer.json new file mode 120000 index 00000000..2489da33 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/tcp-balancer.json @@ -0,0 +1 @@ +../../../apps/tcp-balancer/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/tenant.json b/packages/system/cozystack-api/openapi-schemas/tenant.json new file mode 120000 index 00000000..5c71197b --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/tenant.json @@ -0,0 +1 @@ +../../../apps/tenant/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/virtual-machine.json b/packages/system/cozystack-api/openapi-schemas/virtual-machine.json new file mode 120000 index 00000000..c5898f0b --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/virtual-machine.json @@ -0,0 +1 @@ +../../../apps/virtual-machine/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/vm-disk.json b/packages/system/cozystack-api/openapi-schemas/vm-disk.json new file mode 120000 index 00000000..c8490747 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/vm-disk.json @@ -0,0 +1 @@ +../../../apps/vm-disk/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/vm-instance.json b/packages/system/cozystack-api/openapi-schemas/vm-instance.json new file mode 120000 index 00000000..7dcbad17 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/vm-instance.json @@ -0,0 +1 @@ +../../../apps/vm-instance/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/openapi-schemas/vpn.json b/packages/system/cozystack-api/openapi-schemas/vpn.json new file mode 120000 index 00000000..018a6380 --- /dev/null +++ b/packages/system/cozystack-api/openapi-schemas/vpn.json @@ -0,0 +1 @@ +../../../apps/vpn/values.schema.json \ No newline at end of file diff --git a/packages/system/cozystack-api/templates/configmap.yaml b/packages/system/cozystack-api/templates/configmap.yaml index 8fccd427..b873ae69 100644 --- a/packages/system/cozystack-api/templates/configmap.yaml +++ b/packages/system/cozystack-api/templates/configmap.yaml @@ -10,6 +10,7 @@ data: kind: Bucket singular: bucket plural: buckets + openAPISchema: {{ .Files.Get "openapi-schemas/bucket.json" | fromJson | toJson | quote }} release: prefix: bucket- labels: @@ -24,6 +25,7 @@ data: kind: ClickHouse singular: clickhouse plural: clickhouses + openAPISchema: {{ .Files.Get "openapi-schemas/clickhouse.json" | fromJson | toJson | quote }} release: prefix: clickhouse- labels: @@ -38,6 +40,7 @@ data: kind: HTTPCache singular: httpcache plural: httpcaches + openAPISchema: {{ .Files.Get "openapi-schemas/http-cache.json" | fromJson | toJson | quote }} release: prefix: http-cache- labels: @@ -52,6 +55,7 @@ data: kind: NATS singular: nats plural: natses + openAPISchema: {{ .Files.Get "openapi-schemas/nats.json" | fromJson | toJson | quote }} release: prefix: nats- labels: @@ -66,6 +70,7 @@ data: kind: TCPBalancer singular: tcpbalancer plural: tcpbalancers + openAPISchema: {{ .Files.Get "openapi-schemas/tcp-balancer.json" | fromJson | toJson | quote }} release: prefix: tcp-balancer- labels: @@ -80,6 +85,7 @@ data: kind: VirtualMachine singular: virtualmachine plural: virtualmachines + openAPISchema: {{ .Files.Get "openapi-schemas/virtual-machine.json" | fromJson | toJson | quote }} release: prefix: virtual-machine- labels: @@ -94,6 +100,7 @@ data: kind: VPN singular: vpn plural: vpns + openAPISchema: {{ .Files.Get "openapi-schemas/vpn.json" | fromJson | toJson | quote }} release: prefix: vpn- labels: @@ -108,6 +115,7 @@ data: kind: MySQL singular: mysql plural: mysqls + openAPISchema: {{ .Files.Get "openapi-schemas/mysql.json" | fromJson | toJson | quote }} release: prefix: mysql- labels: @@ -122,6 +130,7 @@ data: kind: Tenant singular: tenant plural: tenants + openAPISchema: {{ .Files.Get "openapi-schemas/tenant.json" | fromJson | toJson | quote }} release: prefix: tenant- labels: @@ -136,6 +145,7 @@ data: kind: Kubernetes singular: kubernetes plural: kuberneteses + openAPISchema: {{ .Files.Get "openapi-schemas/kubernetes.json" | fromJson | toJson | quote }} release: prefix: kubernetes- labels: @@ -150,6 +160,7 @@ data: kind: Redis singular: redis plural: redises + openAPISchema: {{ .Files.Get "openapi-schemas/redis.json" | fromJson | toJson | quote }} release: prefix: redis- labels: @@ -164,6 +175,7 @@ data: kind: RabbitMQ singular: rabbitmq plural: rabbitmqs + openAPISchema: {{ .Files.Get "openapi-schemas/rabbitmq.json" | fromJson | toJson | quote }} release: prefix: rabbitmq- labels: @@ -178,6 +190,7 @@ data: kind: Postgres singular: postgres plural: postgreses + openAPISchema: {{ .Files.Get "openapi-schemas/postgres.json" | fromJson | toJson | quote }} release: prefix: postgres- labels: @@ -192,6 +205,7 @@ data: kind: FerretDB singular: ferretdb plural: ferretdb + openAPISchema: {{ .Files.Get "openapi-schemas/ferretdb.json" | fromJson | toJson | quote }} release: prefix: ferretdb- labels: @@ -206,6 +220,7 @@ data: kind: Kafka singular: kafka plural: kafkas + openAPISchema: {{ .Files.Get "openapi-schemas/kafka.json" | fromJson | toJson | quote }} release: prefix: kafka- labels: @@ -220,6 +235,7 @@ data: kind: VMDisk plural: vmdisks singular: vmdisk + openAPISchema: {{ .Files.Get "openapi-schemas/vm-disk.json" | fromJson | toJson | quote }} release: prefix: vm-disk- labels: @@ -234,6 +250,7 @@ data: kind: VMInstance plural: vminstances singular: vminstance + openAPISchema: {{ .Files.Get "openapi-schemas/vm-instance.json" | fromJson | toJson | quote }} release: prefix: vm-instance- labels: @@ -248,6 +265,7 @@ data: kind: Monitoring plural: monitorings singular: monitoring + openAPISchema: {{ .Files.Get "openapi-schemas/monitoring.json" | fromJson | toJson | quote }} release: prefix: "" labels: @@ -262,6 +280,7 @@ data: kind: Etcd plural: etcds singular: etcd + openAPISchema: {{ .Files.Get "openapi-schemas/etcd.json" | fromJson | toJson | quote }} release: prefix: "" labels: @@ -276,6 +295,7 @@ data: kind: Ingress plural: ingresses singular: ingress + openAPISchema: {{ .Files.Get "openapi-schemas/ingress.json" | fromJson | toJson | quote }} release: prefix: "" labels: @@ -290,6 +310,7 @@ data: kind: SeaweedFS plural: seaweedfses singular: seaweedfs + openAPISchema: {{ .Files.Get "openapi-schemas/seaweedfs.json" | fromJson | toJson | quote }} release: prefix: "" labels: @@ -304,6 +325,7 @@ data: kind: BootBox plural: bootboxes singular: bootbox + openAPISchema: {{ .Files.Get "openapi-schemas/bootbox.json" | fromJson | toJson | quote }} release: prefix: "" labels: @@ -318,6 +340,7 @@ data: kind: Info plural: infos singular: info + openAPISchema: {{ .Files.Get "openapi-schemas/info.json" | fromJson | toJson | quote }} release: prefix: "" labels: