@soft-stech/flux-cd
Version:
268 lines (267 loc) • 9.17 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.v1beta2.Bucket";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"source.toolkit.fluxcd.io/v1beta2"
]
},
"kind": {
"type": "string",
"enum": [
"Bucket"
]
},
"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
},
"bucketName": {
"type": "string"
},
"endpoint": {
"type": "string"
},
"ignore": {
"type": "string",
"nullable": true
},
"insecure": {
"type": "boolean",
"nullable": true
},
"interval": {
"type": "string",
"pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
},
"prefix": {
"type": "string",
"nullable": true
},
"provider": {
"default": "generic",
"enum": [
"generic",
"aws",
"gcp",
"azure"
],
"type": "string",
"nullable": true
},
"region": {
"type": "string",
"nullable": true
},
"secretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
},
"suspend": {
"type": "boolean",
"nullable": true
},
"timeout": {
"default": "60s",
"type": "string",
"pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m))+$",
"nullable": true
}
},
"required": [
"bucketName",
"endpoint",
"interval"
],
"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
},
"observedGeneration": {
"format": "int64",
"type": "integer",
"nullable": true
},
"observedIgnore": {
"type": "string",
"nullable": true
},
"url": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"apiVersion",
"kind"
]
};
/**
* Bucket is the Schema for the buckets API.
*/
export class Bucket extends Model {
constructor(data) {
super({
apiVersion: Bucket.apiVersion,
kind: Bucket.kind,
...data
});
}
}
Bucket.apiVersion = "source.toolkit.fluxcd.io/v1beta2";
Bucket.kind = "Bucket";
Bucket.is = createTypeMetaGuard(Bucket);
setSchema(Bucket, schemaId, () => {
addSchema();
register(schemaId, schema);
});