diff --git a/.reuse/dep5 b/.reuse/dep5 index cdd406d4a..741379db0 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -899,6 +899,10 @@ Files: crd-catalog/tinkerbell/rufio/* Copyright: The tinkerbell/rufio Authors License: Apache-2.0 +Files: crd-catalog/tinkerbell/tink/* +Copyright: The tinkerbell/tink Authors +License: Apache-2.0 + Files: crd-catalog/traefik/traefik/* Copyright: The traefik/traefik Authors License: MIT diff --git a/code-generator/src/catalog.rs b/code-generator/src/catalog.rs index beda1ca66..ec215fada 100644 --- a/code-generator/src/catalog.rs +++ b/code-generator/src/catalog.rs @@ -2348,6 +2348,16 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[ "https://github.com/tinkerbell/rufio/blob/main/config/crd/bases/bmc.tinkerbell.org_tasks.yaml", ], }, + UpstreamSource { + project_name: "tinkerbell/tink", + license: APACHE_V2, + urls: &[ + "https://github.com/tinkerbell/tink/blob/main/config/crd/bases/tinkerbell.org_hardware.yaml", + "https://github.com/tinkerbell/tink/blob/main/config/crd/bases/tinkerbell.org_osies.yaml", + "https://github.com/tinkerbell/tink/blob/main/config/crd/bases/tinkerbell.org_templates.yaml", + "https://github.com/tinkerbell/tink/blob/main/config/crd/bases/tinkerbell.org_workflows.yaml", + ], + }, UpstreamSource { project_name: "traefik/traefik", license: MIT, diff --git a/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/hardware.yaml b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/hardware.yaml new file mode 100644 index 000000000..43ab4e0d8 --- /dev/null +++ b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/hardware.yaml @@ -0,0 +1,364 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.11.4" + name: "hardware.tinkerbell.org" +spec: + group: "tinkerbell.org" + names: + categories: + - "tinkerbell" + kind: "Hardware" + listKind: "HardwareList" + plural: "hardware" + shortNames: + - "hw" + singular: "hardware" + scope: "Namespaced" + versions: + - additionalPrinterColumns: + - jsonPath: ".status.state" + name: "State" + type: "string" + name: "v1alpha1" + schema: + openAPIV3Schema: + description: "Hardware is the Schema for the Hardware 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" + metadata: + type: "object" + spec: + description: "HardwareSpec defines the desired state of Hardware." + properties: + bmcRef: + description: "BMCRef contains a relation to a BMC state management type in the same namespace as the Hardware. This may be used for BMC management by orchestrators." + properties: + apiGroup: + description: "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required." + type: "string" + kind: + description: "Kind is the type of resource being referenced" + type: "string" + name: + description: "Name is the name of resource being referenced" + type: "string" + required: + - "kind" + - "name" + type: "object" + x-kubernetes-map-type: "atomic" + disks: + items: + description: "Disk represents a disk device for Tinkerbell Hardware." + properties: + device: + type: "string" + type: "object" + type: "array" + interfaces: + items: + description: "Interface represents a network interface configuration for Hardware." + properties: + dhcp: + description: "DHCP configuration." + properties: + arch: + type: "string" + hostname: + type: "string" + iface_name: + type: "string" + ip: + description: "IP configuration." + properties: + address: + type: "string" + family: + format: "int64" + type: "integer" + gateway: + type: "string" + netmask: + type: "string" + type: "object" + lease_time: + format: "int64" + type: "integer" + mac: + pattern: "([0-9a-f]{2}[:]){5}([0-9a-f]{2})" + type: "string" + name_servers: + items: + type: "string" + type: "array" + time_servers: + items: + type: "string" + type: "array" + uefi: + type: "boolean" + vlan_id: + description: "validation pattern for VLANDID is a string number between 0-4096" + pattern: "^(([0-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))(,[1-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))*)$" + type: "string" + type: "object" + netboot: + description: "Netboot configuration." + properties: + allowPXE: + type: "boolean" + allowWorkflow: + type: "boolean" + ipxe: + description: "IPXE configuration." + properties: + contents: + type: "string" + url: + type: "string" + type: "object" + osie: + description: "OSIE configuration." + properties: + baseURL: + type: "string" + initrd: + type: "string" + kernel: + type: "string" + type: "object" + type: "object" + type: "object" + type: "array" + metadata: + properties: + bonding_mode: + format: "int64" + type: "integer" + custom: + properties: + preinstalled_operating_system_version: + properties: + distro: + type: "string" + image_tag: + type: "string" + os_slug: + type: "string" + slug: + type: "string" + version: + type: "string" + type: "object" + private_subnets: + items: + type: "string" + type: "array" + type: "object" + facility: + properties: + facility_code: + type: "string" + plan_slug: + type: "string" + plan_version_slug: + type: "string" + type: "object" + instance: + properties: + allow_pxe: + type: "boolean" + always_pxe: + type: "boolean" + crypted_root_password: + type: "string" + hostname: + type: "string" + id: + type: "string" + ips: + items: + properties: + address: + type: "string" + family: + format: "int64" + type: "integer" + gateway: + type: "string" + management: + type: "boolean" + netmask: + type: "string" + public: + type: "boolean" + type: "object" + type: "array" + ipxe_script_url: + type: "string" + network_ready: + type: "boolean" + operating_system: + properties: + distro: + type: "string" + image_tag: + type: "string" + os_slug: + type: "string" + slug: + type: "string" + version: + type: "string" + type: "object" + rescue: + type: "boolean" + ssh_keys: + items: + type: "string" + type: "array" + state: + type: "string" + storage: + properties: + disks: + items: + properties: + device: + type: "string" + partitions: + items: + properties: + label: + type: "string" + number: + format: "int64" + type: "integer" + size: + format: "int64" + type: "integer" + start: + format: "int64" + type: "integer" + type_guid: + type: "string" + type: "object" + type: "array" + wipe_table: + type: "boolean" + type: "object" + type: "array" + filesystems: + items: + properties: + mount: + properties: + create: + properties: + force: + type: "boolean" + options: + items: + type: "string" + type: "array" + type: "object" + device: + type: "string" + files: + items: + properties: + contents: + type: "string" + gid: + format: "int64" + type: "integer" + mode: + format: "int64" + type: "integer" + path: + type: "string" + uid: + format: "int64" + type: "integer" + type: "object" + type: "array" + format: + type: "string" + point: + type: "string" + type: "object" + type: "object" + type: "array" + raid: + items: + properties: + devices: + items: + type: "string" + type: "array" + level: + type: "string" + name: + type: "string" + spare: + format: "int64" + type: "integer" + type: "object" + type: "array" + type: "object" + tags: + items: + type: "string" + type: "array" + userdata: + type: "string" + type: "object" + manufacturer: + properties: + id: + type: "string" + slug: + type: "string" + type: "object" + state: + default: "provisioning" + type: "string" + type: "object" + resources: + additionalProperties: + anyOf: + - type: "integer" + - type: "string" + pattern: "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$" + x-kubernetes-int-or-string: true + description: "Resources represents known resources that are available on a machine. Resources may be used for scheduling by orchestrators." + type: "object" + tinkVersion: + format: "int64" + type: "integer" + userData: + description: "UserData is the user data to configure in the hardware's metadata" + type: "string" + vendorData: + description: "VendorData is the vendor data to configure in the hardware's metadata" + type: "string" + type: "object" + status: + description: "HardwareStatus defines the observed state of Hardware." + properties: + state: + description: "HardwareState represents the hardware state." + type: "string" + type: "object" + type: "object" + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/osies.yaml b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/osies.yaml new file mode 100644 index 000000000..80f7672ca --- /dev/null +++ b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/osies.yaml @@ -0,0 +1,31 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.11.4" + name: "osies.tinkerbell.org" +spec: + group: "tinkerbell.org" + names: + categories: + - "tinkerbell" + kind: "OSIE" + listKind: "OSIEList" + plural: "osies" + singular: "osie" + scope: "Namespaced" + versions: + - name: "v1alpha1" + schema: + openAPIV3Schema: + description: "OSIE configuration." + properties: + baseURL: + type: "string" + initrd: + type: "string" + kernel: + type: "string" + type: "object" + served: true + storage: false diff --git a/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/templates.yaml b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/templates.yaml new file mode 100644 index 000000000..52db510d1 --- /dev/null +++ b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/templates.yaml @@ -0,0 +1,54 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.11.4" + name: "templates.tinkerbell.org" +spec: + group: "tinkerbell.org" + names: + categories: + - "tinkerbell" + kind: "Template" + listKind: "TemplateList" + plural: "templates" + shortNames: + - "tpl" + singular: "template" + scope: "Namespaced" + versions: + - additionalPrinterColumns: + - jsonPath: ".status.state" + name: "State" + type: "string" + name: "v1alpha1" + schema: + openAPIV3Schema: + description: "Template is the Schema for the Templates 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" + metadata: + type: "object" + spec: + description: "TemplateSpec defines the desired state of Template." + properties: + data: + type: "string" + type: "object" + status: + description: "TemplateStatus defines the observed state of Template." + properties: + state: + description: "TemplateState represents the template state." + type: "string" + type: "object" + type: "object" + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/workflows.yaml b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/workflows.yaml new file mode 100644 index 000000000..0f48a12fd --- /dev/null +++ b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/workflows.yaml @@ -0,0 +1,130 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.11.4" + name: "workflows.tinkerbell.org" +spec: + group: "tinkerbell.org" + names: + categories: + - "tinkerbell" + kind: "Workflow" + listKind: "WorkflowList" + plural: "workflows" + shortNames: + - "wf" + singular: "workflow" + scope: "Namespaced" + versions: + - additionalPrinterColumns: + - jsonPath: ".spec.templateRef" + name: "Template" + type: "string" + - jsonPath: ".status.state" + name: "State" + type: "string" + name: "v1alpha1" + schema: + openAPIV3Schema: + description: "Workflow is the Schema for the Workflows 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" + metadata: + type: "object" + spec: + description: "WorkflowSpec defines the desired state of Workflow." + properties: + hardwareMap: + additionalProperties: + type: "string" + description: "A mapping of template devices to hadware mac addresses" + type: "object" + hardwareRef: + description: "Name of the Hardware associated with this workflow." + type: "string" + templateRef: + description: "Name of the Template associated with this workflow." + type: "string" + type: "object" + status: + description: "WorkflowStatus defines the observed state of Workflow." + properties: + globalTimeout: + description: "GlobalTimeout represents the max execution time" + format: "int64" + type: "integer" + state: + description: "State is the state of the workflow in Tinkerbell." + type: "string" + tasks: + description: "Tasks are the tasks to be completed" + items: + description: "Task represents a series of actions to be completed by a worker." + properties: + actions: + items: + description: "Action represents a workflow action." + properties: + command: + items: + type: "string" + type: "array" + environment: + additionalProperties: + type: "string" + type: "object" + image: + type: "string" + message: + type: "string" + name: + type: "string" + pid: + type: "string" + seconds: + format: "int64" + type: "integer" + startedAt: + format: "date-time" + type: "string" + status: + type: "string" + timeout: + format: "int64" + type: "integer" + volumes: + items: + type: "string" + type: "array" + type: "object" + type: "array" + environment: + additionalProperties: + type: "string" + type: "object" + name: + type: "string" + volumes: + items: + type: "string" + type: "array" + worker: + type: "string" + required: + - "actions" + - "name" + - "worker" + type: "object" + type: "array" + type: "object" + type: "object" + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/hardware.yaml b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/hardware.yaml new file mode 100644 index 000000000..031ac9cb0 --- /dev/null +++ b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/hardware.yaml @@ -0,0 +1,150 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.11.4" + name: "hardware.tinkerbell.org" +spec: + group: "tinkerbell.org" + names: + categories: + - "tinkerbell" + kind: "Hardware" + listKind: "HardwareList" + plural: "hardware" + shortNames: + - "hw" + singular: "hardware" + scope: "Namespaced" + versions: + - additionalPrinterColumns: + - description: "Baseboard management computer attached to the Hardware" + jsonPath: ".spec.bmcRef" + name: "BMC" + type: "string" + name: "v1alpha2" + schema: + openAPIV3Schema: + description: "Hardware is a logical representation of a machine that can execute Workflows." + 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" + metadata: + type: "object" + spec: + properties: + bmcRef: + description: "BMCRef references a Rufio Machine object." + properties: + name: + 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?" + type: "string" + type: "object" + x-kubernetes-map-type: "atomic" + instance: + description: "Instance describes instance specific data that is generally unused by Tinkerbell core." + properties: + userdata: + description: "Userdata is data with a structure understood by the producer and consumer of the data." + type: "string" + vendordata: + description: "Vendordata is data with a structure understood by the producer and consumer of the data." + type: "string" + type: "object" + ipxe: + description: "IPXE provides iPXE script override fields. This is useful for debugging or netboot customization." + properties: + inline: + description: "Content is an inline iPXE script." + type: "string" + url: + description: "URL is a URL to a hosted iPXE script." + type: "string" + type: "object" + kernelParams: + description: "KernelParams passed to the kernel when launching the OSIE. Parameters are joined with a space." + items: + type: "string" + type: "array" + networkInterfaces: + additionalProperties: + description: "NetworkInterface is the desired configuration for a particular network interface." + properties: + dhcp: + description: "DHCP is the basic network information for serving DHCP requests. Required when DisbaleDHCP is false." + properties: + gateway: + description: "Gateway is the default gateway address to serve." + pattern: "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}" + type: "string" + hostname: + pattern: "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9]\"[A-Za-z0-9\\-]*[A-Za-z0-9])$" + type: "string" + ip: + description: "IP is an IPv4 address to serve." + pattern: "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}" + type: "string" + leaseTimeSeconds: + default: 86400 + description: "LeaseTimeSeconds to serve. 24h default. Maximum equates to max uint32 as defined by RFC 2132 § 9.2 (https://www.rfc-editor.org/rfc/rfc2132.html#section-9.2)." + format: "int64" + maximum: 4294967295.0 + minimum: 0.0 + type: "integer" + nameservers: + description: "Nameservers to serve." + items: + description: "Nameserver is an IP or hostname." + pattern: "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + type: "string" + type: "array" + netmask: + description: "Netmask is an IPv4 netmask to serve." + type: "string" + timeservers: + description: "Timeservers to serve." + items: + description: "Timeserver is an IP or hostname." + pattern: "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + type: "string" + type: "array" + vlanId: + description: "VLANID is a VLAN ID between 0 and 4096." + pattern: "^(([0-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))(,[1-9][0-9]{0,2}|[1-3][0-9][0-9][0-9]|40([0-8][0-9]|9[0-6]))*)$" + type: "string" + type: "object" + disableDhcp: + default: false + description: "DisableDHCP disables DHCP for this interface. Implies DisableNetboot." + type: "boolean" + disableNetboot: + default: false + description: "DisableNetboot disables netbooting for this interface. The interface will still receive network information specified by DHCP." + type: "boolean" + type: "object" + description: "NetworkInterfaces defines the desired DHCP and netboot configuration for a network interface." + type: "object" + osie: + description: "OSIE describes the Operating System Installation Environment to be netbooted." + properties: + name: + 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?" + type: "string" + type: "object" + x-kubernetes-map-type: "atomic" + storageDevices: + description: "StorageDevices is a list of storage devices that will be available in the OSIE." + items: + description: "StorageDevice describes a storage device path that will be present in the OSIE. StorageDevices must be valid Linux paths. They should not contain partitions. \n Good \n /dev/sda /dev/nvme0n1 \n Bad (contains partitions) \n /dev/sda1 /dev/nvme0n1p1 \n Bad (invalid Linux path) \n \\dev\\sda" + pattern: "^(/[^/ ]*)+/?$" + type: "string" + type: "array" + type: "object" + type: "object" + served: false + storage: false + subresources: {} diff --git a/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/osies.yaml b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/osies.yaml new file mode 100644 index 000000000..a54facb2e --- /dev/null +++ b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/osies.yaml @@ -0,0 +1,42 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.11.4" + name: "osies.tinkerbell.org" +spec: + group: "tinkerbell.org" + names: + categories: + - "tinkerbell" + kind: "OSIE" + listKind: "OSIEList" + plural: "osies" + singular: "osie" + scope: "Namespaced" + versions: + - name: "v1alpha2" + schema: + openAPIV3Schema: + description: "OSIE describes an Operating System Installation Environment. It is used by Tinkerbell to provision machines and should launch the Tink Worker component." + 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" + metadata: + type: "object" + spec: + properties: + initrdUrl: + description: "InitrdURL is a URL to an initrd image." + type: "string" + kernelUrl: + description: "KernelURL is a URL to a kernel image." + type: "string" + type: "object" + type: "object" + served: true + storage: true diff --git a/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/templates.yaml b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/templates.yaml new file mode 100644 index 000000000..b0b028cc3 --- /dev/null +++ b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/templates.yaml @@ -0,0 +1,96 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.11.4" + name: "templates.tinkerbell.org" +spec: + group: "tinkerbell.org" + names: + categories: + - "tinkerbell" + kind: "Template" + listKind: "TemplateList" + plural: "templates" + shortNames: + - "tpl" + singular: "template" + scope: "Namespaced" + versions: + - name: "v1alpha2" + schema: + openAPIV3Schema: + description: "Template defines a set of actions to be run on a target machine. The template is rendered prior to execution where it is exposed to Hardware and user defined data. Most fields within the TemplateSpec may contain templates values excluding .TemplateSpec.Actions[].Name. See https://pkg.go.dev/text/template for more details." + 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" + metadata: + type: "object" + spec: + properties: + actions: + description: "Actions defines the set of actions to be run on a target machine. Actions are run sequentially in the order they are specified. At least 1 action must be specified. Names of actions must be unique within a Template." + items: + description: "Action defines an individual action to be run on a target machine." + properties: + args: + description: "Args are a set of arguments to be passed to the command executed by the container on launch." + items: + type: "string" + type: "array" + cmd: + description: "Cmd defines the command to use when launching the image. It overrides the default command of the action. It must be a unix path to an executable program." + pattern: "^(/[^/ ]*)+/?$" + type: "string" + env: + additionalProperties: + type: "string" + description: "Env defines environment variables used when launching the container." + type: "object" + image: + description: "Image is an OCI image." + type: "string" + name: + description: "Name is a name for the action." + type: "string" + namespaces: + description: "Namespace defines the Linux namespaces this container should execute in." + properties: + network: + description: "Network defines the network namespace." + type: "string" + pid: + description: "PID defines the PID namespace" + type: "integer" + type: "object" + volumes: + description: "Volumes defines the volumes to mount into the container." + items: + description: "Volume is a specification for mounting a volume in an action. Volumes take the form {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that does not exist it will be created for you. Examples: \n Read-only bind mount bound to /data \n /etc/data:/data:ro \n Writable volume name bound to /data \n shared_volume:/data \n See https://docs.docker.com/storage/volumes/ for additional details." + type: "string" + type: "array" + required: + - "image" + - "name" + type: "object" + minItems: 1 + type: "array" + env: + additionalProperties: + type: "string" + description: "Env defines environment variables to be available in all actions. If an action specifies the same environment variable it will take precedence." + type: "object" + volumes: + description: "Volumes to be mounted on all actions. If an action specifies the same volume it will take precedence." + items: + description: "Volume is a specification for mounting a volume in an action. Volumes take the form {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that does not exist it will be created for you. Examples: \n Read-only bind mount bound to /data \n /etc/data:/data:ro \n Writable volume name bound to /data \n shared_volume:/data \n See https://docs.docker.com/storage/volumes/ for additional details." + type: "string" + type: "array" + type: "object" + type: "object" + served: false + storage: false diff --git a/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/workflows.yaml b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/workflows.yaml new file mode 100644 index 000000000..1791c5124 --- /dev/null +++ b/crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/workflows.yaml @@ -0,0 +1,196 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.11.4" + name: "workflows.tinkerbell.org" +spec: + group: "tinkerbell.org" + names: + categories: + - "tinkerbell" + kind: "Workflow" + listKind: "WorkflowList" + plural: "workflows" + shortNames: + - "wf" + singular: "workflow" + scope: "Namespaced" + versions: + - additionalPrinterColumns: + - description: "State of the workflow such as Pending,Running etc" + jsonPath: ".status.state" + name: "State" + type: "string" + - description: "Hardware object that runs the workflow" + jsonPath: ".spec.hardwareRef" + name: "Hardware" + type: "string" + - description: "Template to run on the associated Hardware" + jsonPath: ".spec.templateRef" + name: "Template" + type: "string" + name: "v1alpha2" + schema: + openAPIV3Schema: + description: "Workflow describes a set of actions to be run on a specific Hardware. Workflows execute once and should be considered ephemeral." + 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" + metadata: + type: "object" + spec: + properties: + hardwareRef: + description: "HardwareRef is a reference to a Hardware resource this workflow will execute on." + properties: + name: + 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?" + type: "string" + type: "object" + x-kubernetes-map-type: "atomic" + templateParams: + additionalProperties: + type: "string" + description: "TemplateParams are a list of key-value pairs that are injected into templates at render time. TemplateParams are exposed to templates using a top level .Params key. \n For example, TemplateParams = {\"foo\": \"bar\"}, the foo key can be accessed via .Params.foo." + type: "object" + templateRef: + description: "TemplateRef is a reference to a Template resource used to render workflow actions." + properties: + name: + 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?" + type: "string" + type: "object" + x-kubernetes-map-type: "atomic" + timeout: + default: 0 + description: "TimeoutSeconds defines the time the workflow has to complete. The timer begins when the first action is requested. When set to 0, no timeout is applied." + format: "int64" + minimum: 0.0 + type: "integer" + type: "object" + status: + properties: + actions: + description: "Actions is a list of action states." + items: + description: "ActionStatus describes status information about an action." + properties: + failureMessage: + description: "FailureMessage is a free-form user friendly message describing why the Action entered the ActionStateFailed state. Typically, this is an elaboration on the Reason." + type: "string" + failureReason: + description: "FailureReason is a short CamelCase word or phrase describing why the Action entered ActionStateFailed." + type: "string" + id: + description: "ID uniquely identifies the action status." + type: "string" + lastTransitioned: + description: "LastTransition is the observed time when State transitioned last." + format: "date-time" + type: "string" + rendered: + description: "Rendered is the rendered action." + properties: + args: + description: "Args are a set of arguments to be passed to the command executed by the container on launch." + items: + type: "string" + type: "array" + cmd: + description: "Cmd defines the command to use when launching the image. It overrides the default command of the action. It must be a unix path to an executable program." + pattern: "^(/[^/ ]*)+/?$" + type: "string" + env: + additionalProperties: + type: "string" + description: "Env defines environment variables used when launching the container." + type: "object" + image: + description: "Image is an OCI image." + type: "string" + name: + description: "Name is a name for the action." + type: "string" + namespaces: + description: "Namespace defines the Linux namespaces this container should execute in." + properties: + network: + description: "Network defines the network namespace." + type: "string" + pid: + description: "PID defines the PID namespace" + type: "integer" + type: "object" + volumes: + description: "Volumes defines the volumes to mount into the container." + items: + description: "Volume is a specification for mounting a volume in an action. Volumes take the form {SRC-VOLUME-NAME | SRC-HOST-DIR}:TGT-CONTAINER-DIR:OPTIONS. When specifying a VOLUME-NAME that does not exist it will be created for you. Examples: \n Read-only bind mount bound to /data \n /etc/data:/data:ro \n Writable volume name bound to /data \n shared_volume:/data \n See https://docs.docker.com/storage/volumes/ for additional details." + type: "string" + type: "array" + required: + - "image" + - "name" + type: "object" + startedAt: + description: "StartedAt is the time the action was started as reported by the client. Nil indicates the Action has not started." + format: "date-time" + type: "string" + state: + description: "State describes the current state of the action." + type: "string" + required: + - "id" + type: "object" + type: "array" + conditions: + description: "Conditions details a set of observations about the Workflow." + items: + description: "Condition defines an observation on a resource that is generally attainable by inspecting other status fields." + properties: + lastTransitionTime: + description: "LastTransition is the last time the condition transitioned from one status to another." + format: "date-time" + type: "string" + message: + description: "Message is a human readable message indicating details about the last transition." + type: "string" + reason: + description: "Reason is a short CamelCase description for the conditions last transition." + type: "string" + status: + description: "Status of the condition." + type: "string" + type: + description: "Type of condition." + type: "string" + required: + - "lastTransitionTime" + - "status" + - "type" + type: "object" + type: "array" + lastTransitioned: + description: "LastTransition is the observed time when State transitioned last." + format: "date-time" + type: "string" + startedAt: + description: "StartedAt is the time the first action was requested. Nil indicates the Workflow has not started." + format: "date-time" + type: "string" + state: + description: "State describes the current state of the Workflow." + type: "string" + required: + - "actions" + - "conditions" + type: "object" + type: "object" + served: false + storage: false + subresources: + status: {} diff --git a/kube-custom-resources-rs/Cargo.toml b/kube-custom-resources-rs/Cargo.toml index be2eaba86..4db1a3c25 100644 --- a/kube-custom-resources-rs/Cargo.toml +++ b/kube-custom-resources-rs/Cargo.toml @@ -290,6 +290,7 @@ submariner_io = [] templates_gatekeeper_sh = [] tests_testkube_io = [] theketch_io = [] +tinkerbell_org = [] topology_node_k8s_io = [] topolvm_cybozu_com = [] traefik_io = [] diff --git a/kube-custom-resources-rs/src/lib.rs b/kube-custom-resources-rs/src/lib.rs index 32c755a16..c4ae5d9e8 100644 --- a/kube-custom-resources-rs/src/lib.rs +++ b/kube-custom-resources-rs/src/lib.rs @@ -2320,6 +2320,20 @@ apiVersion `theketch.io/v1beta1`: - `App` - `Job` +## tinkerbell_org + +apiVersion `tinkerbell.org/v1alpha1`: +- `Hardware` +- `OSIE` +- `Template` +- `Workflow` + +apiVersion `tinkerbell.org/v1alpha2`: +- `Hardware` +- `OSIE` +- `Template` +- `Workflow` + ## topology_node_k8s_io apiVersion `topology.node.k8s.io/v1alpha1`: @@ -2963,6 +2977,8 @@ pub mod templates_gatekeeper_sh; pub mod tests_testkube_io; #[cfg(feature = "theketch_io")] pub mod theketch_io; +#[cfg(feature = "tinkerbell_org")] +pub mod tinkerbell_org; #[cfg(feature = "topology_node_k8s_io")] pub mod topology_node_k8s_io; #[cfg(feature = "topolvm_cybozu_com")] diff --git a/kube-custom-resources-rs/src/tinkerbell_org/mod.rs b/kube-custom-resources-rs/src/tinkerbell_org/mod.rs new file mode 100644 index 000000000..5550e626e --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/mod.rs @@ -0,0 +1,2 @@ +pub mod v1alpha1; +pub mod v1alpha2; diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/hardware.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/hardware.rs new file mode 100644 index 000000000..304ce41a2 --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/hardware.rs @@ -0,0 +1,359 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/hardware.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; +use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString; + +/// HardwareSpec defines the desired state of Hardware. +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "tinkerbell.org", version = "v1alpha1", kind = "Hardware", plural = "hardware")] +#[kube(namespaced)] +#[kube(status = "HardwareStatus")] +#[kube(schema = "disabled")] +pub struct HardwareSpec { + /// BMCRef contains a relation to a BMC state management type in the same namespace as the Hardware. This may be used for BMC management by orchestrators. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "bmcRef")] + pub bmc_ref: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub disks: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub interfaces: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Resources represents known resources that are available on a machine. Resources may be used for scheduling by orchestrators. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resources: Option>, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "tinkVersion")] + pub tink_version: Option, + /// UserData is the user data to configure in the hardware's metadata + #[serde(default, skip_serializing_if = "Option::is_none", rename = "userData")] + pub user_data: Option, + /// VendorData is the vendor data to configure in the hardware's metadata + #[serde(default, skip_serializing_if = "Option::is_none", rename = "vendorData")] + pub vendor_data: Option, +} + +/// BMCRef contains a relation to a BMC state management type in the same namespace as the Hardware. This may be used for BMC management by orchestrators. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareBmcRef { + /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")] + pub api_group: Option, + /// Kind is the type of resource being referenced + pub kind: String, + /// Name is the name of resource being referenced + pub name: String, +} + +/// Disk represents a disk device for Tinkerbell Hardware. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareDisks { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub device: Option, +} + +/// Interface represents a network interface configuration for Hardware. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareInterfaces { + /// DHCP configuration. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dhcp: Option, + /// Netboot configuration. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub netboot: Option, +} + +/// DHCP configuration. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareInterfacesDhcp { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub arch: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hostname: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub iface_name: Option, + /// IP configuration. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub lease_time: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mac: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name_servers: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub time_servers: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uefi: Option, + /// validation pattern for VLANDID is a string number between 0-4096 + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vlan_id: Option, +} + +/// IP configuration. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareInterfacesDhcpIp { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub family: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gateway: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub netmask: Option, +} + +/// Netboot configuration. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareInterfacesNetboot { + #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowPXE")] + pub allow_pxe: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowWorkflow")] + pub allow_workflow: Option, + /// IPXE configuration. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ipxe: Option, + /// OSIE configuration. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub osie: Option, +} + +/// IPXE configuration. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareInterfacesNetbootIpxe { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub contents: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +/// OSIE configuration. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareInterfacesNetbootOsie { + #[serde(default, skip_serializing_if = "Option::is_none", rename = "baseURL")] + pub base_url: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub initrd: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub kernel: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadata { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bonding_mode: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub custom: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub facility: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub instance: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub manufacturer: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataCustom { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preinstalled_operating_system_version: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub private_subnets: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataCustomPreinstalledOperatingSystemVersion { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distro: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image_tag: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub os_slug: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataFacility { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub facility_code: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan_slug: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plan_version_slug: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstance { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub allow_pxe: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub always_pxe: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub crypted_root_password: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hostname: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ips: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ipxe_script_url: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub network_ready: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operating_system: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rescue: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ssh_keys: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub storage: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub userdata: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceIps { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub family: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gateway: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub management: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub netmask: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub public: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceOperatingSystem { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub distro: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image_tag: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub os_slug: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceStorage { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub disks: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filesystems: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub raid: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceStorageDisks { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub device: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub partitions: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wipe_table: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceStorageDisksPartitions { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub size: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub type_guid: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceStorageFilesystems { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mount: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceStorageFilesystemsMount { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub create: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub device: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub files: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub format: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub point: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceStorageFilesystemsMountCreate { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub force: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub options: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceStorageFilesystemsMountFiles { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub contents: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mode: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub uid: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataInstanceStorageRaid { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub devices: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub level: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub spare: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareMetadataManufacturer { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub slug: Option, +} + +/// HardwareStatus defines the observed state of Hardware. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareStatus { + /// HardwareState represents the hardware state. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, +} + diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/mod.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/mod.rs new file mode 100644 index 000000000..290417994 --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/mod.rs @@ -0,0 +1,4 @@ +pub mod hardware; +pub mod osies; +pub mod templates; +pub mod workflows; diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/osies.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/osies.rs new file mode 100644 index 000000000..6687208f6 --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/osies.rs @@ -0,0 +1,7 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/osies.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + + + + diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/templates.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/templates.rs new file mode 100644 index 000000000..4b75f021a --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/templates.rs @@ -0,0 +1,26 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/templates.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; + +/// TemplateSpec defines the desired state of Template. +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "tinkerbell.org", version = "v1alpha1", kind = "Template", plural = "templates")] +#[kube(namespaced)] +#[kube(status = "TemplateStatus")] +#[kube(schema = "disabled")] +pub struct TemplateSpec { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option, +} + +/// TemplateStatus defines the observed state of Template. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TemplateStatus { + /// TemplateState represents the template state. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, +} + diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/workflows.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/workflows.rs new file mode 100644 index 000000000..11ae1ce4e --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha1/workflows.rs @@ -0,0 +1,79 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha1/workflows.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// WorkflowSpec defines the desired state of Workflow. +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "tinkerbell.org", version = "v1alpha1", kind = "Workflow", plural = "workflows")] +#[kube(namespaced)] +#[kube(status = "WorkflowStatus")] +#[kube(schema = "disabled")] +pub struct WorkflowSpec { + /// A mapping of template devices to hadware mac addresses + #[serde(default, skip_serializing_if = "Option::is_none", rename = "hardwareMap")] + pub hardware_map: Option>, + /// Name of the Hardware associated with this workflow. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "hardwareRef")] + pub hardware_ref: Option, + /// Name of the Template associated with this workflow. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "templateRef")] + pub template_ref: Option, +} + +/// WorkflowStatus defines the observed state of Workflow. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowStatus { + /// GlobalTimeout represents the max execution time + #[serde(default, skip_serializing_if = "Option::is_none", rename = "globalTimeout")] + pub global_timeout: Option, + /// State is the state of the workflow in Tinkerbell. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + /// Tasks are the tasks to be completed + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tasks: Option>, +} + +/// Task represents a series of actions to be completed by a worker. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowStatusTasks { + pub actions: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option>, + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub volumes: Option>, + pub worker: String, +} + +/// Action represents a workflow action. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowStatusTasksActions { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub command: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub environment: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pid: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub seconds: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "startedAt")] + pub started_at: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub volumes: Option>, +} + diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/hardware.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/hardware.rs new file mode 100644 index 000000000..f1e1bd776 --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/hardware.rs @@ -0,0 +1,116 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/hardware.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "tinkerbell.org", version = "v1alpha2", kind = "Hardware", plural = "hardware")] +#[kube(namespaced)] +#[kube(schema = "disabled")] +pub struct HardwareSpec { + /// BMCRef references a Rufio Machine object. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "bmcRef")] + pub bmc_ref: Option, + /// Instance describes instance specific data that is generally unused by Tinkerbell core. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub instance: Option, + /// IPXE provides iPXE script override fields. This is useful for debugging or netboot customization. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ipxe: Option, + /// KernelParams passed to the kernel when launching the OSIE. Parameters are joined with a space. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "kernelParams")] + pub kernel_params: Option>, + /// NetworkInterfaces defines the desired DHCP and netboot configuration for a network interface. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "networkInterfaces")] + pub network_interfaces: Option>, + /// OSIE describes the Operating System Installation Environment to be netbooted. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub osie: Option, + /// StorageDevices is a list of storage devices that will be available in the OSIE. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "storageDevices")] + pub storage_devices: Option>, +} + +/// BMCRef references a Rufio Machine object. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareBmcRef { + /// 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? + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +/// Instance describes instance specific data that is generally unused by Tinkerbell core. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareInstance { + /// Userdata is data with a structure understood by the producer and consumer of the data. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub userdata: Option, + /// Vendordata is data with a structure understood by the producer and consumer of the data. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub vendordata: Option, +} + +/// IPXE provides iPXE script override fields. This is useful for debugging or netboot customization. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareIpxe { + /// Content is an inline iPXE script. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub inline: Option, + /// URL is a URL to a hosted iPXE script. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +/// NetworkInterfaces defines the desired DHCP and netboot configuration for a network interface. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareNetworkInterfaces { + /// DHCP is the basic network information for serving DHCP requests. Required when DisbaleDHCP is false. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dhcp: Option, + /// DisableDHCP disables DHCP for this interface. Implies DisableNetboot. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableDhcp")] + pub disable_dhcp: Option, + /// DisableNetboot disables netbooting for this interface. The interface will still receive network information specified by DHCP. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableNetboot")] + pub disable_netboot: Option, +} + +/// DHCP is the basic network information for serving DHCP requests. Required when DisbaleDHCP is false. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareNetworkInterfacesDhcp { + /// Gateway is the default gateway address to serve. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gateway: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hostname: Option, + /// IP is an IPv4 address to serve. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip: Option, + /// LeaseTimeSeconds to serve. 24h default. Maximum equates to max uint32 as defined by RFC 2132 § 9.2 (https://www.rfc-editor.org/rfc/rfc2132.html#section-9.2). + #[serde(default, skip_serializing_if = "Option::is_none", rename = "leaseTimeSeconds")] + pub lease_time_seconds: Option, + /// Nameservers to serve. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nameservers: Option>, + /// Netmask is an IPv4 netmask to serve. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub netmask: Option, + /// Timeservers to serve. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeservers: Option>, + /// VLANID is a VLAN ID between 0 and 4096. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "vlanId")] + pub vlan_id: Option, +} + +/// OSIE describes the Operating System Installation Environment to be netbooted. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct HardwareOsie { + /// 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? + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} + diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/mod.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/mod.rs new file mode 100644 index 000000000..290417994 --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/mod.rs @@ -0,0 +1,4 @@ +pub mod hardware; +pub mod osies; +pub mod templates; +pub mod workflows; diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/osies.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/osies.rs new file mode 100644 index 000000000..d2d2f6c0b --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/osies.rs @@ -0,0 +1,20 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/osies.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "tinkerbell.org", version = "v1alpha2", kind = "OSIE", plural = "osies")] +#[kube(namespaced)] +#[kube(schema = "disabled")] +pub struct OSIESpec { + /// InitrdURL is a URL to an initrd image. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "initrdUrl")] + pub initrd_url: Option, + /// KernelURL is a URL to a kernel image. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "kernelUrl")] + pub kernel_url: Option, +} + diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/templates.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/templates.rs new file mode 100644 index 000000000..b002c9146 --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/templates.rs @@ -0,0 +1,59 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/templates.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "tinkerbell.org", version = "v1alpha2", kind = "Template", plural = "templates")] +#[kube(namespaced)] +#[kube(schema = "disabled")] +pub struct TemplateSpec { + /// Actions defines the set of actions to be run on a target machine. Actions are run sequentially in the order they are specified. At least 1 action must be specified. Names of actions must be unique within a Template. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub actions: Option>, + /// Env defines environment variables to be available in all actions. If an action specifies the same environment variable it will take precedence. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub env: Option>, + /// Volumes to be mounted on all actions. If an action specifies the same volume it will take precedence. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub volumes: Option>, +} + +/// Action defines an individual action to be run on a target machine. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TemplateActions { + /// Args are a set of arguments to be passed to the command executed by the container on launch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub args: Option>, + /// Cmd defines the command to use when launching the image. It overrides the default command of the action. It must be a unix path to an executable program. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cmd: Option, + /// Env defines environment variables used when launching the container. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub env: Option>, + /// Image is an OCI image. + pub image: String, + /// Name is a name for the action. + pub name: String, + /// Namespace defines the Linux namespaces this container should execute in. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespaces: Option, + /// Volumes defines the volumes to mount into the container. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub volumes: Option>, +} + +/// Namespace defines the Linux namespaces this container should execute in. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct TemplateActionsNamespaces { + /// Network defines the network namespace. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub network: Option, + /// PID defines the PID namespace + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pid: Option, +} + diff --git a/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/workflows.rs b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/workflows.rs new file mode 100644 index 000000000..c6500ea31 --- /dev/null +++ b/kube-custom-resources-rs/src/tinkerbell_org/v1alpha2/workflows.rs @@ -0,0 +1,141 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/tinkerbell/tink/tinkerbell.org/v1alpha2/workflows.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "tinkerbell.org", version = "v1alpha2", kind = "Workflow", plural = "workflows")] +#[kube(namespaced)] +#[kube(status = "WorkflowStatus")] +#[kube(schema = "disabled")] +pub struct WorkflowSpec { + /// HardwareRef is a reference to a Hardware resource this workflow will execute on. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "hardwareRef")] + pub hardware_ref: Option, + /// TemplateParams are a list of key-value pairs that are injected into templates at render time. TemplateParams are exposed to templates using a top level .Params key. + /// For example, TemplateParams = {"foo": "bar"}, the foo key can be accessed via .Params.foo. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "templateParams")] + pub template_params: Option>, + /// TemplateRef is a reference to a Template resource used to render workflow actions. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "templateRef")] + pub template_ref: Option, + /// TimeoutSeconds defines the time the workflow has to complete. The timer begins when the first action is requested. When set to 0, no timeout is applied. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout: Option, +} + +/// HardwareRef is a reference to a Hardware resource this workflow will execute on. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowHardwareRef { + /// 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? + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +/// TemplateRef is a reference to a Template resource used to render workflow actions. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowTemplateRef { + /// 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? + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowStatus { + /// Actions is a list of action states. + pub actions: Vec, + /// Conditions details a set of observations about the Workflow. + pub conditions: Vec, + /// LastTransition is the observed time when State transitioned last. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastTransitioned")] + pub last_transitioned: Option, + /// StartedAt is the time the first action was requested. Nil indicates the Workflow has not started. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "startedAt")] + pub started_at: Option, + /// State describes the current state of the Workflow. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, +} + +/// ActionStatus describes status information about an action. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowStatusActions { + /// FailureMessage is a free-form user friendly message describing why the Action entered the ActionStateFailed state. Typically, this is an elaboration on the Reason. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureMessage")] + pub failure_message: Option, + /// FailureReason is a short CamelCase word or phrase describing why the Action entered ActionStateFailed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureReason")] + pub failure_reason: Option, + /// ID uniquely identifies the action status. + pub id: String, + /// LastTransition is the observed time when State transitioned last. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastTransitioned")] + pub last_transitioned: Option, + /// Rendered is the rendered action. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rendered: Option, + /// StartedAt is the time the action was started as reported by the client. Nil indicates the Action has not started. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "startedAt")] + pub started_at: Option, + /// State describes the current state of the action. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, +} + +/// Rendered is the rendered action. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowStatusActionsRendered { + /// Args are a set of arguments to be passed to the command executed by the container on launch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub args: Option>, + /// Cmd defines the command to use when launching the image. It overrides the default command of the action. It must be a unix path to an executable program. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub cmd: Option, + /// Env defines environment variables used when launching the container. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub env: Option>, + /// Image is an OCI image. + pub image: String, + /// Name is a name for the action. + pub name: String, + /// Namespace defines the Linux namespaces this container should execute in. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespaces: Option, + /// Volumes defines the volumes to mount into the container. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub volumes: Option>, +} + +/// Namespace defines the Linux namespaces this container should execute in. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowStatusActionsRenderedNamespaces { + /// Network defines the network namespace. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub network: Option, + /// PID defines the PID namespace + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pid: Option, +} + +/// Condition defines an observation on a resource that is generally attainable by inspecting other status fields. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct WorkflowStatusConditions { + /// LastTransition is the last time the condition transitioned from one status to another. + #[serde(rename = "lastTransitionTime")] + pub last_transition_time: String, + /// Message is a human readable message indicating details about the last transition. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, + /// Reason is a short CamelCase description for the conditions last transition. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Status of the condition. + pub status: String, + /// Type of condition. + #[serde(rename = "type")] + pub r#type: String, +} +