@soft-stech/fleet
Version:
688 lines (687 loc) • 29 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 = "fleet.cattle.io.v1alpha1.GitRepo";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"fleet.cattle.io/v1alpha1"
]
},
"kind": {
"type": "string",
"enum": [
"GitRepo"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"branch": {
"nullable": true,
"type": "string"
},
"caBundle": {
"format": "byte",
"nullable": true,
"type": "string"
},
"clientSecretName": {
"nullable": true,
"type": "string"
},
"correctDrift": {
"properties": {
"enabled": {
"type": "boolean",
"nullable": true
},
"force": {
"type": "boolean",
"nullable": true
},
"keepFailHistory": {
"type": "boolean",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"deleteNamespace": {
"type": "boolean",
"nullable": true
},
"disablePolling": {
"type": "boolean",
"nullable": true
},
"forceSyncGeneration": {
"format": "int64",
"type": "integer",
"nullable": true
},
"helmRepoURLRegex": {
"nullable": true,
"type": "string"
},
"helmSecretName": {
"nullable": true,
"type": "string"
},
"helmSecretNameForPaths": {
"nullable": true,
"type": "string"
},
"imageScanCommit": {
"properties": {
"authorEmail": {
"nullable": true,
"type": "string"
},
"authorName": {
"nullable": true,
"type": "string"
},
"messageTemplate": {
"nullable": true,
"type": "string"
}
},
"type": "object",
"nullable": true
},
"imageScanInterval": {
"type": "string",
"nullable": true
},
"insecureSkipTLSVerify": {
"type": "boolean",
"nullable": true
},
"keepResources": {
"type": "boolean",
"nullable": true
},
"ociRegistry": {
"properties": {
"authSecretName": {
"nullable": true,
"type": "string"
},
"basicHTTP": {
"nullable": true,
"type": "boolean"
},
"insecureSkipTLS": {
"nullable": true,
"type": "boolean"
},
"reference": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"paths": {
"items": {
"type": "string"
},
"nullable": true,
"type": "array"
},
"paused": {
"type": "boolean",
"nullable": true
},
"pollingInterval": {
"nullable": true,
"type": "string"
},
"repo": {
"nullable": true,
"type": "string"
},
"revision": {
"nullable": true,
"type": "string"
},
"serviceAccount": {
"nullable": true,
"type": "string"
},
"targetNamespace": {
"nullable": true,
"type": "string"
},
"targets": {
"items": {
"properties": {
"clusterGroup": {
"nullable": true,
"type": "string"
},
"clusterGroupSelector": {
"nullable": true,
"properties": {
"matchExpressions": {
"items": {
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"values": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
}
},
"required": [
"key",
"operator"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"matchLabels": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"properties": {},
"nullable": true
}
},
"type": "object"
},
"clusterName": {
"nullable": true,
"type": "string"
},
"clusterSelector": {
"nullable": true,
"properties": {
"matchExpressions": {
"items": {
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"values": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
}
},
"required": [
"key",
"operator"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"matchLabels": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"properties": {},
"nullable": true
}
},
"type": "object"
},
"name": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"type": "array",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"status": {
"properties": {
"commit": {
"type": "string",
"nullable": true
},
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"type": "string",
"nullable": true
},
"lastUpdateTime": {
"type": "string",
"nullable": true
},
"message": {
"type": "string",
"nullable": true
},
"reason": {
"type": "string",
"nullable": true
},
"status": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"status",
"type"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"desiredReadyClusters": {
"type": "integer",
"nullable": true
},
"display": {
"properties": {
"error": {
"type": "boolean",
"nullable": true
},
"message": {
"type": "string",
"nullable": true
},
"readyBundleDeployments": {
"type": "string",
"nullable": true
},
"state": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"gitJobStatus": {
"type": "string",
"nullable": true
},
"lastPollingTriggered": {
"format": "date-time",
"type": "string",
"nullable": true
},
"lastSyncedImageScanTime": {
"format": "date-time",
"type": "string",
"nullable": true
},
"observedGeneration": {
"format": "int64",
"type": "integer",
"nullable": true
},
"readyClusters": {
"type": "integer",
"nullable": true
},
"resourceCounts": {
"properties": {
"desiredReady": {
"type": "integer",
"nullable": true
},
"missing": {
"type": "integer",
"nullable": true
},
"modified": {
"type": "integer",
"nullable": true
},
"notReady": {
"type": "integer",
"nullable": true
},
"orphaned": {
"type": "integer",
"nullable": true
},
"ready": {
"type": "integer",
"nullable": true
},
"unknown": {
"type": "integer",
"nullable": true
},
"waitApplied": {
"type": "integer",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"resourceErrors": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"resources": {
"items": {
"properties": {
"apiVersion": {
"nullable": true,
"type": "string"
},
"error": {
"type": "boolean",
"nullable": true
},
"id": {
"nullable": true,
"type": "string"
},
"incompleteState": {
"type": "boolean",
"nullable": true
},
"kind": {
"nullable": true,
"type": "string"
},
"message": {
"nullable": true,
"type": "string"
},
"name": {
"nullable": true,
"type": "string"
},
"namespace": {
"nullable": true,
"type": "string"
},
"perClusterState": {
"items": {
"properties": {
"clusterId": {
"nullable": true,
"type": "string"
},
"error": {
"type": "boolean",
"nullable": true
},
"message": {
"nullable": true,
"type": "string"
},
"patch": {
"nullable": true,
"type": "object",
"properties": {}
},
"state": {
"nullable": true,
"type": "string"
},
"transitioning": {
"type": "boolean",
"nullable": true
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"state": {
"type": "string",
"nullable": true
},
"transitioning": {
"type": "boolean",
"nullable": true
},
"type": {
"type": "string",
"nullable": true
}
},
"type": "object"
},
"type": "array",
"nullable": true
},
"summary": {
"properties": {
"desiredReady": {
"type": "integer",
"nullable": true
},
"errApplied": {
"type": "integer",
"nullable": true
},
"modified": {
"type": "integer",
"nullable": true
},
"nonReadyResources": {
"items": {
"properties": {
"bundleState": {
"nullable": true,
"type": "string"
},
"message": {
"nullable": true,
"type": "string"
},
"modifiedStatus": {
"items": {
"properties": {
"apiVersion": {
"nullable": true,
"type": "string"
},
"delete": {
"type": "boolean",
"nullable": true
},
"kind": {
"nullable": true,
"type": "string"
},
"missing": {
"type": "boolean",
"nullable": true
},
"name": {
"nullable": true,
"type": "string"
},
"namespace": {
"nullable": true,
"type": "string"
},
"patch": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"name": {
"nullable": true,
"type": "string"
},
"nonReadyStatus": {
"items": {
"properties": {
"apiVersion": {
"nullable": true,
"type": "string"
},
"kind": {
"nullable": true,
"type": "string"
},
"name": {
"nullable": true,
"type": "string"
},
"namespace": {
"nullable": true,
"type": "string"
},
"summary": {
"properties": {
"error": {
"type": "boolean",
"nullable": true
},
"message": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"state": {
"type": "string",
"nullable": true
},
"transitioning": {
"type": "boolean",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"uid": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"notReady": {
"type": "integer",
"nullable": true
},
"outOfSync": {
"type": "integer",
"nullable": true
},
"pending": {
"type": "integer",
"nullable": true
},
"ready": {
"type": "integer",
"nullable": true
},
"waitApplied": {
"type": "integer",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"updateGeneration": {
"format": "int64",
"type": "integer",
"nullable": true
},
"webhookCommit": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"apiVersion",
"kind"
]
};
/**
* GitRepo describes a git repository that is watched by Fleet.
* The resource contains the necessary information to deploy the repo, or parts
* of it, to target clusters.
*/
export class GitRepo extends Model {
constructor(data) {
super({
apiVersion: GitRepo.apiVersion,
kind: GitRepo.kind,
...data
});
}
}
GitRepo.apiVersion = "fleet.cattle.io/v1alpha1";
GitRepo.kind = "GitRepo";
GitRepo.is = createTypeMetaGuard(GitRepo);
setSchema(GitRepo, schemaId, () => {
addSchema();
register(schemaId, schema);
});