diff --git a/generators/artifacthub/crossplane-types/CompositeResourceDefinition.json b/generators/artifacthub/crossplane-types/CompositeResourceDefinition.json new file mode 100644 index 00000000..a53428be --- /dev/null +++ b/generators/artifacthub/crossplane-types/CompositeResourceDefinition.json @@ -0,0 +1,37 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Composite Resource Definition", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"name": "crossplane-types", +"displayName": "crossplane-types", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": false +}, +"component": { +"kind": "CompositeResourceDefinition", +"version": "apiextensions.crossplane.io/v1alpha1", +"schema": "{\n \"description\": \"An CompositeResourceDefinition defines a new kind of composite infrastructure resource. The new resource is composed of other composite or managed infrastructure resources.\",\n \"properties\": {\n \"spec\": {\n \"description\": \"CompositeResourceDefinitionSpec specifies the desired state of the definition.\",\n \"properties\": {\n \"claimNames\": {\n \"description\": \"ClaimNames specifies the names of an optional composite resource claim. When claim names are specified Crossplane will create a namespaced 'composite resource claim' CRD that corresponds to the defined composite resource. This composite resource claim acts as a namespaced proxy for the composite resource; creating, updating, or deleting the claim will create, update, or delete a corresponding composite resource. You may add claim names to an existing CompositeResourceDefinition, but they cannot be changed once they have been set.\",\n \"properties\": {\n \"categories\": {\n \"description\": \"categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like `kubectl get all`.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"kind\": {\n \"description\": \"kind is the serialized kind of the resource. It is normally CamelCase and singular. Custom resource instances will use this value as the `kind` attribute in API calls.\",\n \"type\": \"string\"\n },\n \"listKind\": {\n \"description\": \"listKind is the serialized kind of the list for this resource. Defaults to \\\"`kind`List\\\".\",\n \"type\": \"string\"\n },\n \"plural\": {\n \"description\": \"plural is the plural name of the resource to serve. The custom resources are served under `/apis/\\u003cgroup\\u003e/\\u003cversion\\u003e/.../\\u003cplural\\u003e`. Must match the name of the CustomResourceDefinition (in the form `\\u003cnames.plural\\u003e.\\u003cgroup\\u003e`). Must be all lowercase.\",\n \"type\": \"string\"\n },\n \"shortNames\": {\n \"description\": \"shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like `kubectl get \\u003cshortname\\u003e`. It must be all lowercase.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"singular\": {\n \"description\": \"singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"kind\",\n \"plural\"\n ],\n \"type\": \"object\"\n },\n \"connectionSecretKeys\": {\n \"description\": \"ConnectionSecretKeys is the list of keys that will be exposed to the end user of the defined kind.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"crdSpecTemplate\": {\n \"description\": \"CRDSpecTemplate is the base CRD template. The final CRD will have additional fields to the base template to accommodate Crossplane machinery.\",\n \"properties\": {\n \"additionalPrinterColumns\": {\n \"description\": \"additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. If present, this field configures columns for all versions. Top-level and per-version columns are mutually exclusive. If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.\",\n \"items\": {\n \"description\": \"CustomResourceColumnDefinition specifies a column for server side printing.\",\n \"properties\": {\n \"JSONPath\": {\n \"description\": \"JSONPath is a simple JSON path (i.e. with array notation) which is evaluated against each custom resource to produce the value for this column.\",\n \"type\": \"string\"\n },\n \"description\": {\n \"description\": \"description is a human readable description of this column.\",\n \"type\": \"string\"\n },\n \"format\": {\n \"description\": \"format is an optional OpenAPI type definition for this column. The 'name' format is applied to the primary identifier column to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details.\",\n \"type\": \"string\"\n },\n \"name\": {\n \"description\": \"name is a human readable name for the column.\",\n \"type\": \"string\"\n },\n \"priority\": {\n \"description\": \"priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a priority greater than 0.\",\n \"format\": \"int32\",\n \"type\": \"integer\"\n },\n \"type\": {\n \"description\": \"type is an OpenAPI type definition for this column. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"JSONPath\",\n \"name\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"group\": {\n \"description\": \"group is the API group of the defined custom resource. The custom resources are served under `/apis/\\u003cgroup\\u003e/...`. Must match the name of the CustomResourceDefinition (in the form `\\u003cnames.plural\\u003e.\\u003cgroup\\u003e`).\",\n \"type\": \"string\"\n },\n \"names\": {\n \"description\": \"names specify the resource and kind names for the custom resource.\",\n \"properties\": {\n \"categories\": {\n \"description\": \"categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like `kubectl get all`.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"kind\": {\n \"description\": \"kind is the serialized kind of the resource. It is normally CamelCase and singular. Custom resource instances will use this value as the `kind` attribute in API calls.\",\n \"type\": \"string\"\n },\n \"listKind\": {\n \"description\": \"listKind is the serialized kind of the list for this resource. Defaults to \\\"`kind`List\\\".\",\n \"type\": \"string\"\n },\n \"plural\": {\n \"description\": \"plural is the plural name of the resource to serve. The custom resources are served under `/apis/\\u003cgroup\\u003e/\\u003cversion\\u003e/.../\\u003cplural\\u003e`. Must match the name of the CustomResourceDefinition (in the form `\\u003cnames.plural\\u003e.\\u003cgroup\\u003e`). Must be all lowercase.\",\n \"type\": \"string\"\n },\n \"shortNames\": {\n \"description\": \"shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like `kubectl get \\u003cshortname\\u003e`. It must be all lowercase.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"singular\": {\n \"description\": \"singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"kind\",\n \"plural\"\n ],\n \"type\": \"object\"\n },\n \"validation\": {\n \"description\": \"validation describes the schema used for validation and pruning of the custom resource. If present, this validation schema is used to validate all versions. Top-level and per-version schemas are mutually exclusive.\",\n \"properties\": {\n \"openAPIV3Schema\": {\n \"description\": \"openAPIV3Schema is the OpenAPI v3 schema to use for validation and pruning.\",\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n },\n \"version\": {\n \"description\": \"version is the API version of the defined custom resource. The custom resources are served under `/apis/\\u003cgroup\\u003e/\\u003cversion\\u003e/...`. Must match the name of the first item in the `versions` list if `version` and `versions` are both specified. Optional if `versions` is specified. Deprecated: use `versions` instead.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"group\",\n \"names\"\n ],\n \"type\": \"object\"\n },\n \"defaultCompositionRef\": {\n \"description\": \"DefaultCompositionRef refers to the Composition resource that will be used in case no composition selector is given.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referenced object.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\"\n ],\n \"type\": \"object\"\n },\n \"enforcedCompositionRef\": {\n \"description\": \"EnforcedCompositionRef refers to the Composition resource that will be used by all composite instances whose schema is defined by this definition.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referenced object.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\"\n ],\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"title\": \"Composite Resource Definition\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/artifacthub/crossplane-types/Composition.json b/generators/artifacthub/crossplane-types/Composition.json new file mode 100644 index 00000000..5e6db356 --- /dev/null +++ b/generators/artifacthub/crossplane-types/Composition.json @@ -0,0 +1,37 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Composition", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"name": "crossplane-types", +"displayName": "crossplane-types", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": false +}, +"component": { +"kind": "Composition", +"version": "apiextensions.crossplane.io/v1alpha1", +"schema": "{\n \"description\": \"Composition defines the group of resources to be created when a compatible type is created with reference to the composition.\",\n \"properties\": {\n \"spec\": {\n \"description\": \"CompositionSpec specifies the desired state of the definition.\",\n \"properties\": {\n \"compositeTypeRef\": {\n \"description\": \"CompositeTypeRef specifies the type of composite resource that this composition is compatible with.\",\n \"properties\": {\n \"apiVersion\": {\n \"description\": \"APIVersion of the type.\",\n \"type\": \"string\"\n },\n \"kind\": {\n \"description\": \"Kind of the type.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"apiVersion\",\n \"kind\"\n ],\n \"type\": \"object\"\n },\n \"resources\": {\n \"description\": \"Resources is the list of resource templates that will be used when a composite resource referring to this composition is created.\",\n \"items\": {\n \"description\": \"ComposedTemplate is used to provide information about how the composed resource should be processed.\",\n \"properties\": {\n \"base\": {\n \"description\": \"Base is the target resource that the patches will be applied on.\",\n \"type\": \"object\"\n },\n \"connectionDetails\": {\n \"description\": \"ConnectionDetails lists the propagation secret keys from this target resource to the composition instance connection secret.\",\n \"items\": {\n \"description\": \"ConnectionDetail includes the information about the propagation of the connection information from one secret to another.\",\n \"properties\": {\n \"fromConnectionSecretKey\": {\n \"description\": \"FromConnectionSecretKey is the key that will be used to fetch the value from the given target resource.\",\n \"type\": \"string\"\n },\n \"name\": {\n \"description\": \"Name of the connection secret key that will be propagated to the connection secret of the composition instance. Leave empty if you'd like to use the same key name.\",\n \"type\": \"string\"\n },\n \"value\": {\n \"description\": \"Value that will be propagated to the connection secret of the composition instance. Typically you should use FromConnectionSecretKey instead, but an explicit value may be set to inject a fixed, non-sensitive connection secret values, for example a well-known port. Supercedes FromConnectionSecretKey when set.\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"patches\": {\n \"description\": \"Patches will be applied as overlay to the base resource.\",\n \"items\": {\n \"description\": \"Patch is used to patch the field on the base resource at ToFieldPath after piping the value that is at FromFieldPath of the target resource through transformers.\",\n \"properties\": {\n \"fromFieldPath\": {\n \"description\": \"FromFieldPath is the path of the field on the upstream resource whose value to be used as input.\",\n \"type\": \"string\"\n },\n \"toFieldPath\": {\n \"description\": \"ToFieldPath is the path of the field on the base resource whose value will be changed with the result of transforms. Leave empty if you'd like to propagate to the same path on the target resource.\",\n \"type\": \"string\"\n },\n \"transforms\": {\n \"description\": \"Transforms are the list of functions that are used as a FIFO pipe for the input to be transformed.\",\n \"items\": {\n \"description\": \"Transform is a unit of process whose input is transformed into an output with the supplied configuration.\",\n \"properties\": {\n \"map\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"description\": \"Map uses the input as a key in the given map and returns the value.\",\n \"type\": \"object\"\n },\n \"math\": {\n \"description\": \"Math is used to transform the input via mathematical operations such as multiplication.\",\n \"properties\": {\n \"multiply\": {\n \"description\": \"Multiply the value.\",\n \"format\": \"int64\",\n \"type\": \"integer\"\n }\n },\n \"type\": \"object\"\n },\n \"string\": {\n \"description\": \"String is used to transform the input into a string or a different kind of string. Note that the input does not necessarily need to be a string.\",\n \"properties\": {\n \"fmt\": {\n \"description\": \"Format the input using a Go format string. See https://golang.org/pkg/fmt/ for details.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fmt\"\n ],\n \"type\": \"object\"\n },\n \"type\": {\n \"description\": \"Type of the transform to be run.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"fromFieldPath\"\n ],\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"readinessChecks\": {\n \"description\": \"ReadinessChecks allows users to define custom readiness checks. All checks have to return true in order for resource to be considered ready. The default readiness check is to have the \\\"Ready\\\" condition to be \\\"True\\\".\",\n \"items\": {\n \"description\": \"ReadinessCheck is used to indicate how to tell whether a resource is ready for consumption\",\n \"properties\": {\n \"fieldPath\": {\n \"description\": \"FieldPath shows the path of the field whose value will be used.\",\n \"type\": \"string\"\n },\n \"matchInteger\": {\n \"description\": \"MatchInt is the value you'd like to match if you're using \\\"MatchInt\\\" type.\",\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n \"matchString\": {\n \"description\": \"MatchString is the value you'd like to match if you're using \\\"MatchString\\\" type.\",\n \"type\": \"string\"\n },\n \"type\": {\n \"description\": \"Type indicates the type of probe you'd like to use.\",\n \"enum\": [\n \"MatchString\",\n \"MatchInteger\",\n \"NonEmpty\"\n ],\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldPath\",\n \"type\"\n ],\n \"type\": \"object\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"base\"\n ],\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"writeConnectionSecretsToNamespace\": {\n \"description\": \"WriteConnectionSecretsToNamespace specifies the namespace in which the connection secrets of composite resource dynamically provisioned using this composition will be created.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"compositeTypeRef\",\n \"resources\"\n ],\n \"type\": \"object\"\n }\n },\n \"title\": \"Composition\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/artifacthub/crossplane-types/Configuration.json b/generators/artifacthub/crossplane-types/Configuration.json new file mode 100644 index 00000000..60e9be9b --- /dev/null +++ b/generators/artifacthub/crossplane-types/Configuration.json @@ -0,0 +1,37 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Configuration", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"name": "crossplane-types", +"displayName": "crossplane-types", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": false +}, +"component": { +"kind": "Configuration", +"version": "pkg.crossplane.io/v1alpha1", +"schema": "{\n \"description\": \"Configuration is the CRD type for a request to add a configuration to Crossplane.\",\n \"properties\": {\n \"spec\": {\n \"description\": \"ConfigurationSpec specifies details about a request to install a configuration to Crossplane.\",\n \"properties\": {\n \"package\": {\n \"description\": \"Package is the name of the package that is being requested.\",\n \"type\": \"string\"\n },\n \"packagePullPolicy\": {\n \"description\": \"PackagePullPolicy defines the pull policy for the package.\",\n \"type\": \"string\"\n },\n \"packagePullSecrets\": {\n \"description\": \"PackagePullSecrets are named secrets in the same namespace that can be used to fetch packages from private registries.\",\n \"items\": {\n \"description\": \"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"revisionActivationPolicy\": {\n \"description\": \"RevisionActivationPolicy specifies how the package controller should update from one revision to the next. Options are Automatic or Manual. Default is Automatic.\",\n \"type\": \"string\"\n },\n \"revisionHistoryLimit\": {\n \"description\": \"RevisionHistoryLimit dictates how the package controller cleans up old inactive package revisions. Defaults to 1. Can be disabled by explicitly setting to 0.\",\n \"format\": \"int64\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"package\"\n ],\n \"type\": \"object\"\n }\n },\n \"title\": \"Configuration\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/artifacthub/crossplane-types/ConfigurationRevision.json b/generators/artifacthub/crossplane-types/ConfigurationRevision.json new file mode 100644 index 00000000..4f64e6c6 --- /dev/null +++ b/generators/artifacthub/crossplane-types/ConfigurationRevision.json @@ -0,0 +1,37 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Configuration Revision", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"name": "crossplane-types", +"displayName": "crossplane-types", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": false +}, +"component": { +"kind": "ConfigurationRevision", +"version": "pkg.crossplane.io/v1alpha1", +"schema": "{\n \"description\": \"A ConfigurationRevision that has been added to Crossplane.\",\n \"properties\": {\n \"spec\": {\n \"description\": \"PackageRevisionSpec specifies the desired state of a PackageRevision.\",\n \"properties\": {\n \"desiredState\": {\n \"description\": \"DesiredState of the PackageRevision. Can be either Active or Inactive.\",\n \"type\": \"string\"\n },\n \"image\": {\n \"description\": \"Image used for install Pod to extract package contents.\",\n \"type\": \"string\"\n },\n \"installPodRef\": {\n \"description\": \"Reference to install Pod. PackageRevision reads logs of this Pod to create resources owned by the PackageRevision.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referenced object.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\"\n ],\n \"type\": \"object\"\n },\n \"revision\": {\n \"description\": \"Revision number. Indicates when the revision will be garbage collected based on the parent's RevisionHistoryLimit.\",\n \"format\": \"int64\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"desiredState\",\n \"image\",\n \"installPodRef\",\n \"revision\"\n ],\n \"type\": \"object\"\n }\n },\n \"title\": \"Configuration Revision\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/artifacthub/crossplane-types/KubernetesApplication.json b/generators/artifacthub/crossplane-types/KubernetesApplication.json new file mode 100644 index 00000000..ac9fff4b --- /dev/null +++ b/generators/artifacthub/crossplane-types/KubernetesApplication.json @@ -0,0 +1,37 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Kubernetes Application", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"name": "crossplane-types", +"displayName": "crossplane-types", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": true +}, +"component": { +"kind": "KubernetesApplication", +"version": "workload.crossplane.io/v1alpha1", +"schema": "{\n \"description\": \"A KubernetesApplication defines an application deployed by Crossplane to a Kubernetes cluster, i.e. a portable KubernetesCluster resource claim. Deprecated: See https://github.com/crossplane/crossplane/issues/1595\",\n \"properties\": {\n \"spec\": {\n \"description\": \"A KubernetesApplicationSpec specifies the resources of a Kubernetes application.\",\n \"properties\": {\n \"resourceSelector\": {\n \"description\": \"ResourceSelector selects the KubernetesApplicationResources that are managed by this KubernetesApplication. Note that a KubernetesApplication will never adopt orphaned KubernetesApplicationResources, and thus this selector serves only to help match a KubernetesApplication to its KubernetesApplicationResources.\",\n \"properties\": {\n \"matchExpressions\": {\n \"description\": \"matchExpressions is a list of label selector requirements. The requirements are ANDed.\",\n \"items\": {\n \"description\": \"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.\",\n \"properties\": {\n \"key\": {\n \"description\": \"key is the label key that the selector applies to.\",\n \"type\": \"string\"\n },\n \"operator\": {\n \"description\": \"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.\",\n \"type\": \"string\"\n },\n \"values\": {\n \"description\": \"values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"key\",\n \"operator\"\n ],\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"matchLabels\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"description\": \"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \\\"key\\\", the operator is \\\"In\\\", and the values array contains only \\\"value\\\". The requirements are ANDed.\",\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n },\n \"resourceTemplates\": {\n \"description\": \"ResourceTemplates specifies a set of Kubernetes application resources managed by this application.\",\n \"items\": {\n \"description\": \"A KubernetesApplicationResourceTemplate is used to instantiate new KubernetesApplicationResources.\",\n \"properties\": {\n \"metadata\": {\n \"type\": \"object\"\n },\n \"spec\": {\n \"description\": \"KubernetesApplicationResourceSpec specifies the desired state of a KubernetesApplicationResource.\",\n \"properties\": {\n \"secrets\": {\n \"description\": \"Secrets upon which this application resource depends. These secrets will be propagated to the Kubernetes cluster to which this application is scheduled.\",\n \"items\": {\n \"description\": \"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"targetRef\": {\n \"description\": \"Target to which this application has been scheduled.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\"\n ],\n \"type\": \"object\"\n },\n \"template\": {\n \"description\": \"A Template for a Kubernetes resource to be submitted to the KubernetesCluster to which this application resource is scheduled. The resource must be understood by the KubernetesCluster. Crossplane requires only that the resource contains standard Kubernetes type and object metadata.\",\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"template\"\n ],\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"targetRef\": {\n \"description\": \"Target to which this application has been scheduled.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\"\n ],\n \"type\": \"object\"\n },\n \"targetSelector\": {\n \"description\": \"TargetSelector selects the targets to which this application may be scheduled. Leave both match labels and expressions empty to match any target.\",\n \"properties\": {\n \"matchExpressions\": {\n \"description\": \"matchExpressions is a list of label selector requirements. The requirements are ANDed.\",\n \"items\": {\n \"description\": \"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.\",\n \"properties\": {\n \"key\": {\n \"description\": \"key is the label key that the selector applies to.\",\n \"type\": \"string\"\n },\n \"operator\": {\n \"description\": \"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.\",\n \"type\": \"string\"\n },\n \"values\": {\n \"description\": \"values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"key\",\n \"operator\"\n ],\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"matchLabels\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"description\": \"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \\\"key\\\", the operator is \\\"In\\\", and the values array contains only \\\"value\\\". The requirements are ANDed.\",\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"resourceSelector\",\n \"resourceTemplates\"\n ],\n \"type\": \"object\"\n }\n },\n \"title\": \"Kubernetes Application\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/artifacthub/crossplane-types/KubernetesApplicationResource.json b/generators/artifacthub/crossplane-types/KubernetesApplicationResource.json new file mode 100644 index 00000000..966821e1 --- /dev/null +++ b/generators/artifacthub/crossplane-types/KubernetesApplicationResource.json @@ -0,0 +1,37 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Kubernetes Application Resource", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"name": "crossplane-types", +"displayName": "crossplane-types", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": true +}, +"component": { +"kind": "KubernetesApplicationResource", +"version": "workload.crossplane.io/v1alpha1", +"schema": "{\n \"description\": \"A KubernetesApplicationResource is a resource of a Kubernetes application. Each resource templates a single Kubernetes resource to be deployed to its scheduled KubernetesCluster. Deprecated: See // Deprecated: See https://github.com/crossplane/crossplane/issues/1595\",\n \"properties\": {\n \"spec\": {\n \"description\": \"KubernetesApplicationResourceSpec specifies the desired state of a KubernetesApplicationResource.\",\n \"properties\": {\n \"secrets\": {\n \"description\": \"Secrets upon which this application resource depends. These secrets will be propagated to the Kubernetes cluster to which this application is scheduled.\",\n \"items\": {\n \"description\": \"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"targetRef\": {\n \"description\": \"Target to which this application has been scheduled.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\"\n ],\n \"type\": \"object\"\n },\n \"template\": {\n \"description\": \"A Template for a Kubernetes resource to be submitted to the KubernetesCluster to which this application resource is scheduled. The resource must be understood by the KubernetesCluster. Crossplane requires only that the resource contains standard Kubernetes type and object metadata.\",\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"template\"\n ],\n \"type\": \"object\"\n }\n },\n \"title\": \"Kubernetes Application Resource\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/artifacthub/crossplane-types/KubernetesTarget.json b/generators/artifacthub/crossplane-types/KubernetesTarget.json new file mode 100644 index 00000000..0f92b3b0 --- /dev/null +++ b/generators/artifacthub/crossplane-types/KubernetesTarget.json @@ -0,0 +1,37 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Kubernetes Target", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"name": "crossplane-types", +"displayName": "crossplane-types", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": true +}, +"component": { +"kind": "KubernetesTarget", +"version": "workload.crossplane.io/v1alpha1", +"schema": "{\n \"description\": \"A KubernetesTarget is a scheduling target for a Kubernetes Application. Deprecated: See https://github.com/crossplane/crossplane/issues/1595\",\n \"properties\": {\n \"spec\": {\n \"description\": \"A TargetSpec defines the common fields of objects used for exposing infrastructure to workloads that can be scheduled to.\",\n \"properties\": {\n \"clusterRef\": {\n \"description\": \"A ResourceReference specifies an existing managed resource, in any namespace, which this target should attempt to propagate a connection secret from.\",\n \"properties\": {\n \"apiVersion\": {\n \"description\": \"API version of the referent.\",\n \"type\": \"string\"\n },\n \"fieldPath\": {\n \"description\": \"If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \\\"spec.containers{name}\\\" (where \\\"name\\\" refers to the name of the container that triggered the event) or if no container name is specified \\\"spec.containers[2]\\\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.\",\n \"type\": \"string\"\n },\n \"kind\": {\n \"description\": \"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds\",\n \"type\": \"string\"\n },\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\",\n \"type\": \"string\"\n },\n \"namespace\": {\n \"description\": \"Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/\",\n \"type\": \"string\"\n },\n \"resourceVersion\": {\n \"description\": \"Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency\",\n \"type\": \"string\"\n },\n \"uid\": {\n \"description\": \"UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"connectionSecretRef\": {\n \"description\": \"WriteConnectionSecretToReference specifies the name of a Secret, in the same namespace as this target, to which any connection details for this target should be written or already exist. Connection secrets referenced by a target should contain information for connecting to a resource that allows for scheduling of workloads.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the secret.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\"\n ],\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"spec\"\n ],\n \"title\": \"Kubernetes Target\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/artifacthub/crossplane-types/Provider.json b/generators/artifacthub/crossplane-types/Provider.json new file mode 100644 index 00000000..ee824679 --- /dev/null +++ b/generators/artifacthub/crossplane-types/Provider.json @@ -0,0 +1,37 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Provider", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"name": "crossplane-types", +"displayName": "crossplane-types", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": false +}, +"component": { +"kind": "Provider", +"version": "pkg.crossplane.io/v1alpha1", +"schema": "{\n \"description\": \"Provider is the CRD type for a request to add a provider to Crossplane.\",\n \"properties\": {\n \"spec\": {\n \"description\": \"ProviderSpec specifies details about a request to install a provider to Crossplane.\",\n \"properties\": {\n \"package\": {\n \"description\": \"Package is the name of the package that is being requested.\",\n \"type\": \"string\"\n },\n \"packagePullPolicy\": {\n \"description\": \"PackagePullPolicy defines the pull policy for the package.\",\n \"type\": \"string\"\n },\n \"packagePullSecrets\": {\n \"description\": \"PackagePullSecrets are named secrets in the same namespace that can be used to fetch packages from private registries.\",\n \"items\": {\n \"description\": \"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"type\": \"array\"\n },\n \"revisionActivationPolicy\": {\n \"description\": \"RevisionActivationPolicy specifies how the package controller should update from one revision to the next. Options are Automatic or Manual. Default is Automatic.\",\n \"type\": \"string\"\n },\n \"revisionHistoryLimit\": {\n \"description\": \"RevisionHistoryLimit dictates how the package controller cleans up old inactive package revisions. Defaults to 1. Can be disabled by explicitly setting to 0.\",\n \"format\": \"int64\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"package\"\n ],\n \"type\": \"object\"\n }\n },\n \"title\": \"Provider\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/artifacthub/crossplane-types/ProviderRevision.json b/generators/artifacthub/crossplane-types/ProviderRevision.json new file mode 100644 index 00000000..96fca3e1 --- /dev/null +++ b/generators/artifacthub/crossplane-types/ProviderRevision.json @@ -0,0 +1,37 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Provider Revision", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"name": "crossplane-types", +"displayName": "crossplane-types", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": false +}, +"component": { +"kind": "ProviderRevision", +"version": "pkg.crossplane.io/v1alpha1", +"schema": "{\n \"description\": \"A ProviderRevision that has been added to Crossplane.\",\n \"properties\": {\n \"spec\": {\n \"description\": \"PackageRevisionSpec specifies the desired state of a PackageRevision.\",\n \"properties\": {\n \"desiredState\": {\n \"description\": \"DesiredState of the PackageRevision. Can be either Active or Inactive.\",\n \"type\": \"string\"\n },\n \"image\": {\n \"description\": \"Image used for install Pod to extract package contents.\",\n \"type\": \"string\"\n },\n \"installPodRef\": {\n \"description\": \"Reference to install Pod. PackageRevision reads logs of this Pod to create resources owned by the PackageRevision.\",\n \"properties\": {\n \"name\": {\n \"description\": \"Name of the referenced object.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\"\n ],\n \"type\": \"object\"\n },\n \"revision\": {\n \"description\": \"Revision number. Indicates when the revision will be garbage collected based on the parent's RevisionHistoryLimit.\",\n \"format\": \"int64\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"desiredState\",\n \"image\",\n \"installPodRef\",\n \"revision\"\n ],\n \"type\": \"object\"\n }\n },\n \"title\": \"Provider Revision\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/github/acm-controller/Broker.json b/generators/github/acm-controller/Broker.json new file mode 100644 index 00000000..2656f573 --- /dev/null +++ b/generators/github/acm-controller/Broker.json @@ -0,0 +1,38 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Broker", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"version": "v0.3.0", +"name": "acm-controller", +"displayName": "acm-controller", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "git://github.com/MUzairS15/WASM-filters/main/chart.tar.gz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": true +}, +"component": { +"kind": "Broker", +"version": "meshery.layer5.io/v1alpha1", +"schema": "{\n \"description\": \"Broker is the Schema for the brokers API\",\n \"properties\": {\n \"spec\": {\n \"description\": \"BrokerSpec defines the desired state of Broker\",\n \"properties\": {\n \"size\": {\n \"format\": \"int32\",\n \"type\": \"integer\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"title\": \"Broker\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/github/acm-controller/MeshSync.json b/generators/github/acm-controller/MeshSync.json new file mode 100644 index 00000000..f718fb40 --- /dev/null +++ b/generators/github/acm-controller/MeshSync.json @@ -0,0 +1,38 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "MeshSync", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"version": "v0.3.0", +"name": "acm-controller", +"displayName": "acm-controller", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "git://github.com/MUzairS15/WASM-filters/main/chart.tar.gz" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": true +}, +"component": { +"kind": "MeshSync", +"version": "meshery.layer5.io/v1alpha1", +"schema": "{\n \"description\": \"MeshSync is the Schema for the meshsyncs API\",\n \"properties\": {\n \"spec\": {\n \"description\": \"MeshSyncSpec defines the desired state of MeshSync\",\n \"properties\": {\n \"broker\": {\n \"properties\": {\n \"custom\": {\n \"properties\": {\n \"url\": {\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"native\": {\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"namespace\": {\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n },\n \"size\": {\n \"format\": \"int32\",\n \"type\": \"integer\"\n },\n \"version\": {\n \"type\": \"string\"\n },\n \"watch-list\": {\n \"properties\": {\n \"data\": {\n \"properties\": {\n \"blacklist\": {\n \"type\": \"string\"\n },\n \"whitelist\": {\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"type\": \"object\"\n }\n },\n \"title\": \"MeshSync\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/generators/github/k8s-config-connector/AlloyDBBackup.json b/generators/github/k8s-config-connector/AlloyDBBackup.json new file mode 100644 index 00000000..0ed67c35 --- /dev/null +++ b/generators/github/k8s-config-connector/AlloyDBBackup.json @@ -0,0 +1,38 @@ +{ +"id": "00000000-0000-0000-0000-000000000000", +"schemaVersion": "core.meshery.io/v1beta1", +"displayName": "Alloy DB Backup", +"description": "", +"format": "JSON", +"model": { +"id": "00000000-0000-0000-0000-000000000000", +"version": "1.113.0", +"name": "k8s-config-connector", +"displayName": "k8s-config-connector", +"description": "", +"status": "", +"hostID": "00000000-0000-0000-0000-000000000000", +"registrant": { +"hostname": "" +}, +"category": { +"name": "", +"metadata": null +}, +"subCategory": "", +"metadata": { +"source_uri": "https://raw.githubusercontent.com/GoogleCloudPlatform/k8s-config-connector/master/crds/alloydb_v1beta1_alloydbbackup.yaml/1.113.0" +}, +"model": {}, +"components": null, +"relationships": null +}, +"metadata": { +"isNamespaced": true +}, +"component": { +"kind": "AlloyDBBackup", +"version": "alloydb.cnrm.cloud.google.com/v1beta1", +"schema": "{\n \"properties\": {\n \"spec\": {\n \"properties\": {\n \"clusterNameRef\": {\n \"description\": \"The full resource name of the backup source cluster (e.g., projects/{project}/locations/{location}/clusters/{clusterId}).\",\n \"oneOf\": [\n {\n \"not\": {\n \"required\": [\n \"external\"\n ]\n },\n \"required\": [\n \"name\"\n ]\n },\n {\n \"not\": {\n \"anyOf\": [\n {\n \"required\": [\n \"name\"\n ]\n },\n {\n \"required\": [\n \"namespace\"\n ]\n }\n ]\n },\n \"required\": [\n \"external\"\n ]\n }\n ],\n \"properties\": {\n \"external\": {\n \"description\": \"Allowed value: The `name` field of an `AlloyDBCluster` resource.\",\n \"type\": \"string\"\n },\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\",\n \"type\": \"string\"\n },\n \"namespace\": {\n \"description\": \"Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"description\": {\n \"description\": \"Immutable. User-provided description of the backup.\",\n \"type\": \"string\"\n },\n \"encryptionConfig\": {\n \"description\": \"EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key).\",\n \"properties\": {\n \"kmsKeyName\": {\n \"description\": \"Immutable. The fully-qualified resource name of the KMS key. Each Cloud KMS key is regionalized and has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME].\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"location\": {\n \"description\": \"Immutable. The location where the alloydb backup should reside.\",\n \"type\": \"string\"\n },\n \"projectRef\": {\n \"description\": \"The project that this resource belongs to.\",\n \"oneOf\": [\n {\n \"not\": {\n \"required\": [\n \"external\"\n ]\n },\n \"required\": [\n \"name\"\n ]\n },\n {\n \"not\": {\n \"anyOf\": [\n {\n \"required\": [\n \"name\"\n ]\n },\n {\n \"required\": [\n \"namespace\"\n ]\n }\n ]\n },\n \"required\": [\n \"external\"\n ]\n }\n ],\n \"properties\": {\n \"external\": {\n \"description\": \"Allowed value: The `name` field of a `Project` resource.\",\n \"type\": \"string\"\n },\n \"name\": {\n \"description\": \"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\",\n \"type\": \"string\"\n },\n \"namespace\": {\n \"description\": \"Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/\",\n \"type\": \"string\"\n }\n },\n \"type\": \"object\"\n },\n \"resourceID\": {\n \"description\": \"Immutable. Optional. The backupId of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"clusterNameRef\",\n \"location\",\n \"projectRef\"\n ],\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"spec\"\n ],\n \"title\": \"Alloy DB Backup\",\n \"type\": \"object\"\n}" +} +} \ No newline at end of file diff --git a/utils/kubernetes/describe/describe_test.go b/utils/kubernetes/describe/describe_test.go new file mode 100644 index 00000000..18d6cb0a --- /dev/null +++ b/utils/kubernetes/describe/describe_test.go @@ -0,0 +1,123 @@ +package describe + +import ( + "os" + "path/filepath" + "testing" + + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/rest" + "k8s.io/kubectl/pkg/describe" +) + +// KubeClient interface for mock client +type KubeClient interface { + GetRestConfig() *rest.Config +} + +// MockClient implements a mock Kubernetes client +type MockClient struct { + RestConfig rest.Config +} + +func (c *MockClient) GetRestConfig() *rest.Config { + return &c.RestConfig +} + +// MockDescriberFor returns a mock describer +func MockDescriberFor(kind schema.GroupKind, c *rest.Config) (describe.ResourceDescriber, bool) { + return mockDescriber{}, true +} + +// mockDescriber is a mock implementation of describe.ResourceDescriber +type mockDescriber struct{} + +func (mockDescriber) Describe(namespace, name string, describerSettings describe.DescriberSettings) (string, error) { + if name == "test-invalid" { + return "", ErrGetDescriberFunc() + } + return "mock description", nil +} + +// DescribeWithMock allows injection of a custom DescriberFor function +func DescribeWithMock(client KubeClient, options DescriberOptions, describerFor func(schema.GroupKind, *rest.Config) (describe.ResourceDescriber, bool)) (string, error) { + kind := ResourceMap[options.Type] + describer, ok := describerFor(kind, client.GetRestConfig()) + if !ok { + return "", ErrGetDescriberFunc() + } + describerSetting := describe.DescriberSettings{ + ShowEvents: options.ShowEvents, + ChunkSize: options.ChunkSize, + } + output, err := describer.Describe(options.Namespace, options.Name, describerSetting) + if err != nil { + return "", err + } + return output, nil +} + +func TestDescribe(t *testing.T) { + // Create a temporary directory for test files + tempDir, err := os.MkdirTemp("", "test-describe-") + if err != nil { + t.Fatalf("Failed to create temporary directory: %v", err) + } + defer os.RemoveAll(tempDir) // Clean up the temporary directory after the test + + // Creating a mock client + client := &MockClient{} + + tests := []struct { + name string + options DescriberOptions + wantErr bool + }{ + { + name: "Describe Pod", + options: DescriberOptions{ + Name: "test-pod", + Namespace: "default", + ShowEvents: false, + ChunkSize: 500, + Type: Pod, + }, + wantErr: false, + }, + { + name: "Invalid Resource Type", + options: DescriberOptions{ + Name: "test-invalid", + Namespace: "default", + ShowEvents: false, + ChunkSize: 500, + Type: 999, // Invalid type + }, + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := DescribeWithMock(client, tt.options, MockDescriberFor) + if (err != nil) != tt.wantErr { + t.Errorf("Describe() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !tt.wantErr && got == "" { + t.Errorf("Describe() = %v, want non-empty output", got) + } + + // Create a temporary file to simulate test-generated files + tempFile := filepath.Join(tempDir, "tempfile.txt") + if err := os.WriteFile(tempFile, []byte("temporary content"), 0644); err != nil { + t.Fatalf("Failed to write to temporary file: %v", err) + } + + // Check if the file exists + if _, err := os.Stat(tempFile); os.IsNotExist(err) { + t.Fatalf("Temporary file was not created: %v", err) + } + }) + } +}