@soft-stech/flux-cd
Version:
314 lines (313 loc) • 12.1 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 = "image.toolkit.fluxcd.io.v1beta1.ImageUpdateAutomation";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"image.toolkit.fluxcd.io/v1beta1"
]
},
"kind": {
"type": "string",
"enum": [
"ImageUpdateAutomation"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"git": {
"properties": {
"checkout": {
"properties": {
"ref": {
"properties": {
"branch": {
"type": "string",
"nullable": true
},
"commit": {
"type": "string",
"nullable": true
},
"name": {
"type": "string",
"nullable": true
},
"semver": {
"type": "string",
"nullable": true
},
"tag": {
"type": "string",
"nullable": true
}
},
"type": "object"
}
},
"required": [
"ref"
],
"type": "object",
"nullable": true
},
"commit": {
"properties": {
"author": {
"properties": {
"email": {
"type": "string"
},
"name": {
"type": "string",
"nullable": true
}
},
"required": [
"email"
],
"type": "object"
},
"messageTemplate": {
"type": "string",
"nullable": true
},
"signingKey": {
"properties": {
"secretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"author"
],
"type": "object"
},
"push": {
"properties": {
"branch": {
"type": "string",
"nullable": true
},
"options": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"properties": {},
"nullable": true
},
"refspec": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"commit"
],
"type": "object",
"nullable": true
},
"interval": {
"type": "string",
"pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
},
"sourceRef": {
"properties": {
"apiVersion": {
"type": "string",
"nullable": true
},
"kind": {
"default": "GitRepository",
"enum": [
"GitRepository"
],
"type": "string"
},
"name": {
"type": "string"
},
"namespace": {
"type": "string",
"nullable": true
}
},
"required": [
"kind",
"name"
],
"type": "object"
},
"suspend": {
"type": "boolean",
"nullable": true
},
"update": {
"default": {
"strategy": "Setters"
},
"properties": {
"path": {
"type": "string",
"nullable": true
},
"strategy": {
"default": "Setters",
"enum": [
"Setters"
],
"type": "string"
}
},
"required": [
"strategy"
],
"type": "object",
"nullable": true
}
},
"required": [
"interval",
"sourceRef"
],
"type": "object",
"nullable": true
},
"status": {
"default": {
"observedGeneration": -1
},
"properties": {
"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
},
"lastAutomationRunTime": {
"format": "date-time",
"type": "string",
"nullable": true
},
"lastHandledReconcileAt": {
"type": "string",
"nullable": true
},
"lastPushCommit": {
"type": "string",
"nullable": true
},
"lastPushTime": {
"format": "date-time",
"type": "string",
"nullable": true
},
"observedGeneration": {
"format": "int64",
"type": "integer",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"apiVersion",
"kind"
]
};
/**
* ImageUpdateAutomation is the Schema for the imageupdateautomations API
*/
export class ImageUpdateAutomation extends Model {
constructor(data) {
super({
apiVersion: ImageUpdateAutomation.apiVersion,
kind: ImageUpdateAutomation.kind,
...data
});
}
}
ImageUpdateAutomation.apiVersion = "image.toolkit.fluxcd.io/v1beta1";
ImageUpdateAutomation.kind = "ImageUpdateAutomation";
ImageUpdateAutomation.is = createTypeMetaGuard(ImageUpdateAutomation);
setSchema(ImageUpdateAutomation, schemaId, () => {
addSchema();
register(schemaId, schema);
});