@soft-stech/flux-cd
Version:
347 lines (346 loc) • 12.2 kB
JavaScript
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.v1beta1.GitRepository";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"source.toolkit.fluxcd.io/v1beta1"
]
},
"kind": {
"type": "string",
"enum": [
"GitRepository"
]
},
"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
},
"gitImplementation": {
"default": "go-git",
"enum": [
"go-git",
"libgit2"
],
"type": "string",
"nullable": true
},
"ignore": {
"type": "string",
"nullable": true
},
"include": {
"items": {
"properties": {
"fromPath": {
"type": "string",
"nullable": true
},
"repository": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"toPath": {
"type": "string",
"nullable": true
}
},
"required": [
"repository"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"interval": {
"type": "string"
},
"recurseSubmodules": {
"type": "boolean",
"nullable": true
},
"ref": {
"properties": {
"branch": {
"type": "string",
"nullable": true
},
"commit": {
"type": "string",
"nullable": true
},
"semver": {
"type": "string",
"nullable": true
},
"tag": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"secretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
},
"suspend": {
"type": "boolean",
"nullable": true
},
"timeout": {
"default": "60s",
"type": "string",
"nullable": true
},
"url": {
"type": "string",
"pattern": "^(http|https|ssh):\\/\\/.*$"
},
"verify": {
"properties": {
"mode": {
"enum": [
"head"
],
"type": "string"
},
"secretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
}
},
"required": [
"mode"
],
"type": "object",
"nullable": true
}
},
"required": [
"interval",
"url"
],
"type": "object",
"nullable": true
},
"status": {
"default": {
"observedGeneration": -1
},
"properties": {
"artifact": {
"properties": {
"checksum": {
"type": "string",
"nullable": true
},
"lastUpdateTime": {
"format": "date-time",
"type": "string",
"nullable": true
},
"path": {
"type": "string"
},
"revision": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
}
},
"required": [
"path",
"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
},
"includedArtifacts": {
"items": {
"properties": {
"checksum": {
"type": "string",
"nullable": true
},
"lastUpdateTime": {
"format": "date-time",
"type": "string",
"nullable": true
},
"path": {
"type": "string"
},
"revision": {
"type": "string",
"nullable": true
},
"url": {
"type": "string"
}
},
"required": [
"path",
"url"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"lastHandledReconcileAt": {
"type": "string",
"nullable": true
},
"observedGeneration": {
"format": "int64",
"type": "integer",
"nullable": true
},
"url": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"apiVersion",
"kind"
]
};
/**
* GitRepository is the Schema for the gitrepositories API
*/
export class GitRepository extends Model {
constructor(data) {
super({
apiVersion: GitRepository.apiVersion,
kind: GitRepository.kind,
...data
});
}
}
GitRepository.apiVersion = "source.toolkit.fluxcd.io/v1beta1";
GitRepository.kind = "GitRepository";
GitRepository.is = createTypeMetaGuard(GitRepository);
setSchema(GitRepository, schemaId, () => {
addSchema();
register(schemaId, schema);
});