UNPKG

@soft-stech/flux-cd

Version:
320 lines (319 loc) 11.3 kB
import { addSchema } from "@soft-stech/apimachinery/_schemas/IoK8sApimachineryPkgApisMetaV1ObjectMeta"; import { Model, setSchema, createTypeMetaGuard } from "@soft-stech/base"; import { register } from "@soft-stech/validate"; const schemaId = "source.toolkit.fluxcd.io.v1beta2.HelmChart"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "source.toolkit.fluxcd.io/v1beta2" ] }, "kind": { "type": "string", "enum": [ "HelmChart" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "accessFrom": { "properties": { "namespaceSelectors": { "items": { "properties": { "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object" }, "type": "array" } }, "required": [ "namespaceSelectors" ], "type": "object", "nullable": true }, "chart": { "type": "string" }, "interval": { "type": "string", "pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$" }, "reconcileStrategy": { "default": "ChartVersion", "enum": [ "ChartVersion", "Revision" ], "type": "string", "nullable": true }, "sourceRef": { "properties": { "apiVersion": { "type": "string", "nullable": true }, "kind": { "enum": [ "HelmRepository", "GitRepository", "Bucket" ], "type": "string" }, "name": { "type": "string" } }, "required": [ "kind", "name" ], "type": "object" }, "suspend": { "type": "boolean", "nullable": true }, "valuesFile": { "type": "string", "nullable": true }, "valuesFiles": { "items": { "type": "string" }, "type": "array", "nullable": true }, "verify": { "properties": { "matchOIDCIdentity": { "items": { "properties": { "issuer": { "type": "string" }, "subject": { "type": "string" } }, "required": [ "issuer", "subject" ], "type": "object" }, "type": "array", "nullable": true }, "provider": { "default": "cosign", "enum": [ "cosign" ], "type": "string" }, "secretRef": { "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object", "nullable": true } }, "required": [ "provider" ], "type": "object", "nullable": true }, "version": { "default": "*", "type": "string", "nullable": true } }, "required": [ "chart", "interval", "sourceRef" ], "type": "object", "nullable": true }, "status": { "default": { "observedGeneration": -1 }, "properties": { "artifact": { "properties": { "digest": { "type": "string", "pattern": "^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$", "nullable": true }, "lastUpdateTime": { "format": "date-time", "type": "string" }, "metadata": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true }, "path": { "type": "string" }, "revision": { "type": "string" }, "size": { "format": "int64", "type": "integer", "nullable": true }, "url": { "type": "string" } }, "required": [ "lastUpdateTime", "path", "revision", "url" ], "type": "object", "nullable": true }, "conditions": { "items": { "properties": { "lastTransitionTime": { "format": "date-time", "type": "string" }, "message": { "maxLength": 32768, "type": "string" }, "observedGeneration": { "format": "int64", "type": "integer", "minimum": 0, "nullable": true }, "reason": { "maxLength": 1024, "minLength": 1, "type": "string", "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$" }, "status": { "enum": [ "True", "False", "Unknown" ], "type": "string" }, "type": { "maxLength": 316, "type": "string", "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\\/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$" } }, "required": [ "lastTransitionTime", "message", "reason", "status", "type" ], "type": "object" }, "type": "array", "nullable": true }, "lastHandledReconcileAt": { "type": "string", "nullable": true }, "observedChartName": { "type": "string", "nullable": true }, "observedGeneration": { "format": "int64", "type": "integer", "nullable": true }, "observedSourceArtifactRevision": { "type": "string", "nullable": true }, "url": { "type": "string", "nullable": true } }, "type": "object", "nullable": true } }, "required": [ "apiVersion", "kind" ] }; /** * HelmChart is the Schema for the helmcharts API. */ export class HelmChart extends Model { constructor(data) { super({ apiVersion: HelmChart.apiVersion, kind: HelmChart.kind, ...data }); } } HelmChart.apiVersion = "source.toolkit.fluxcd.io/v1beta2"; HelmChart.kind = "HelmChart"; HelmChart.is = createTypeMetaGuard(HelmChart); setSchema(HelmChart, schemaId, () => { addSchema(); register(schemaId, schema); });