From b5acb46abc19fe17844922f88d7ca9a9f1666f3e Mon Sep 17 00:00:00 2001 From: Enderson Maia Date: Tue, 15 Aug 2023 12:09:40 +0100 Subject: [PATCH] feat: add rollups.cartesi.io/Applications CRD --- charts/applications-crd/.helmignore | 23 ++++++ charts/applications-crd/Chart.yaml | 7 ++ .../applications-crd/ci/test-values.yaml.tpl | 1 + .../rollups.cartesi.io_applications.yaml | 78 +++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 charts/applications-crd/.helmignore create mode 100644 charts/applications-crd/Chart.yaml create mode 100644 charts/applications-crd/ci/test-values.yaml.tpl create mode 100644 charts/applications-crd/templates/rollups.cartesi.io_applications.yaml diff --git a/charts/applications-crd/.helmignore b/charts/applications-crd/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/applications-crd/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/applications-crd/Chart.yaml b/charts/applications-crd/Chart.yaml new file mode 100644 index 0000000..e078cac --- /dev/null +++ b/charts/applications-crd/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: cartesi-applications-crd +description: A Helm chart for Cartesi Application Custom Resource Definitions (CRDs) +type: application +version: v1alpha1 +sources: + - https://github.com/cartesi/helm-charts/ diff --git a/charts/applications-crd/ci/test-values.yaml.tpl b/charts/applications-crd/ci/test-values.yaml.tpl new file mode 100644 index 0000000..a2c5e8b --- /dev/null +++ b/charts/applications-crd/ci/test-values.yaml.tpl @@ -0,0 +1 @@ +{{- /* empty file */}} \ No newline at end of file diff --git a/charts/applications-crd/templates/rollups.cartesi.io_applications.yaml b/charts/applications-crd/templates/rollups.cartesi.io_applications.yaml new file mode 100644 index 0000000..ebc0413 --- /dev/null +++ b/charts/applications-crd/templates/rollups.cartesi.io_applications.yaml @@ -0,0 +1,78 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: applications.rollups.cartesi.io +spec: + group: rollups.cartesi.io + names: + kind: Application + listKind: ApplicationList + plural: applications + singular: application + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: Application is the Schema for the applications API + properties: + apiVersion: + description: + "APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + type: string + kind: + description: + "Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + type: string + status: + description: Status defines the observed state of Application + type: object + metadata: + type: object + spec: + description: Spec defines the desired state of Application + type: object + properties: + address: + description: Address of the application + type: string + pattern: '^0x([a-zA-Z0-9]){40}$' + x-kubernetes-validations: + - rule: "self != oldSelf" + message: "cannot change address" + blockHash: + description: Block hash of the block which deployed the application + type: string + pattern: '^0x([a-zA-Z0-9]){64}$' + x-kubernetes-validations: + - rule: "self != oldSelf" + message: "cannot change blockHash" + blockNumber: + description: Block number of the block which deployed the application + type: string + x-kubernetes-validations: + - rule: "self != oldSelf" + message: "cannot change blockNumber" + transactionHash: + description: Transaction hash of the transaction which deployed the application + type: string + pattern: '^0x([a-zA-Z0-9]){64}$' + x-kubernetes-validations: + - rule: "self != oldSelf" + message: "cannot change transactionHash" + location: + description: Location of the cartesi machine snapshot + type: string + x-kubernetes-validations: + - rule: "self != oldSelf" + message: "cannot change location" + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file