@soft-stech/keda
Version:
KEDA(Kubernetes Event-driven Autoscaling) models
307 lines (306 loc) • 11.9 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 = "keda.sh.v1alpha1.TriggerAuthentication";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"keda.sh/v1alpha1"
]
},
"kind": {
"type": "string",
"enum": [
"TriggerAuthentication"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"azureKeyVault": {
"properties": {
"cloud": {
"properties": {
"activeDirectoryEndpoint": {
"type": "string",
"nullable": true
},
"keyVaultResourceURL": {
"type": "string",
"nullable": true
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object",
"nullable": true
},
"credentials": {
"properties": {
"clientId": {
"type": "string"
},
"clientSecret": {
"properties": {
"valueFrom": {
"properties": {
"secretKeyRef": {
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
}
},
"required": [
"secretKeyRef"
],
"type": "object"
}
},
"required": [
"valueFrom"
],
"type": "object"
},
"tenantId": {
"type": "string"
}
},
"required": [
"clientId",
"clientSecret",
"tenantId"
],
"type": "object",
"nullable": true
},
"podIdentity": {
"properties": {
"identityId": {
"type": "string",
"nullable": true
},
"provider": {
"type": "string"
}
},
"required": [
"provider"
],
"type": "object",
"nullable": true
},
"secrets": {
"items": {
"properties": {
"name": {
"type": "string"
},
"parameter": {
"type": "string"
},
"version": {
"type": "string",
"nullable": true
}
},
"required": [
"name",
"parameter"
],
"type": "object"
},
"type": "array"
},
"vaultUri": {
"type": "string"
}
},
"required": [
"secrets",
"vaultUri"
],
"type": "object",
"nullable": true
},
"env": {
"items": {
"properties": {
"containerName": {
"type": "string",
"nullable": true
},
"name": {
"type": "string"
},
"parameter": {
"type": "string"
}
},
"required": [
"name",
"parameter"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"hashiCorpVault": {
"properties": {
"address": {
"type": "string"
},
"authentication": {
"type": "string"
},
"credential": {
"properties": {
"serviceAccount": {
"type": "string",
"nullable": true
},
"token": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"mount": {
"type": "string",
"nullable": true
},
"namespace": {
"type": "string",
"nullable": true
},
"role": {
"type": "string",
"nullable": true
},
"secrets": {
"items": {
"properties": {
"key": {
"type": "string"
},
"parameter": {
"type": "string"
},
"path": {
"type": "string"
}
},
"required": [
"key",
"parameter",
"path"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"address",
"authentication",
"secrets"
],
"type": "object",
"nullable": true
},
"podIdentity": {
"properties": {
"identityId": {
"type": "string",
"nullable": true
},
"provider": {
"type": "string"
}
},
"required": [
"provider"
],
"type": "object",
"nullable": true
},
"secretTargetRef": {
"items": {
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"parameter": {
"type": "string"
}
},
"required": [
"key",
"name",
"parameter"
],
"type": "object"
},
"type": "array",
"nullable": true
}
},
"type": "object"
}
},
"required": [
"spec",
"apiVersion",
"kind"
]
};
/**
* TriggerAuthentication defines how a trigger can authenticate
*/
export class TriggerAuthentication extends Model {
constructor(data) {
super({
apiVersion: TriggerAuthentication.apiVersion,
kind: TriggerAuthentication.kind,
...data
});
}
}
TriggerAuthentication.apiVersion = "keda.sh/v1alpha1";
TriggerAuthentication.kind = "TriggerAuthentication";
TriggerAuthentication.is = createTypeMetaGuard(TriggerAuthentication);
setSchema(TriggerAuthentication, schemaId, () => {
addSchema();
register(schemaId, schema);
});