Skip to content

Commit

Permalink
add kiegroup/kogito-serverless-operator
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Hoß <[email protected]>
  • Loading branch information
sebhoss committed Nov 12, 2023
1 parent baa6ae5 commit 22da957
Show file tree
Hide file tree
Showing 11 changed files with 2,876 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ Files: crd-catalog/kiegroup/kogito-operator/*
Copyright: The kiegroup/kogito-operator Authors
License: Apache-2.0

Files: crd-catalog/kiegroup/kogito-serverless-operator/*
Copyright: The kiegroup/kogito-serverless-operator Authors
License: Apache-2.0

Files: crd-catalog/knative/operator/*
Copyright: The knative/operator Authors
License: Apache-2.0
Expand Down
9 changes: 9 additions & 0 deletions code-generator/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,15 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[
"https://github.com/kiegroup/kogito-operator/blob/main/config/crd/app/bases/app.kiegroup.org_kogitosupportingservices.yaml",
],
},
UpstreamSource {
project_name: "kiegroup/kogito-serverless-operator",
license: APACHE_V2,
urls: &[
"https://github.com/kiegroup/kogito-serverless-operator/blob/main/config/crd/bases/sonataflow.org_sonataflowbuilds.yaml",
"https://github.com/kiegroup/kogito-serverless-operator/blob/main/config/crd/bases/sonataflow.org_sonataflowplatforms.yaml",
"https://github.com/kiegroup/kogito-serverless-operator/blob/main/config/crd/bases/sonataflow.org_sonataflows.yaml",
],
},
UpstreamSource {
project_name: "knative/operator",
license: APACHE_V2,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Empty file.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions kube-custom-resources-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ serving_kubedl_io_v1alpha1 = []
sfn_services_k8s_aws_v1alpha1 = []
site_superedge_io_v1alpha1 = []
slo_koordinator_sh_v1alpha1 = []
sonataflow_org_v1alpha08 = []
source_toolkit_fluxcd_io_v1beta1 = []
source_toolkit_fluxcd_io_v1beta2 = []
sparkoperator_k8s_io_v1beta2 = []
Expand Down
10 changes: 10 additions & 0 deletions kube-custom-resources-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2447,6 +2447,14 @@ kinds:
- `NodeMetric`
- `NodeSLO`
## sonataflow_org_v1alpha08
apiVersion: `sonataflow.org/v1alpha08`
kinds:
- `SonataFlowBuild`
- `SonataFlowPlatform`
## source_toolkit_fluxcd_io_v1beta1
apiVersion: `source.toolkit.fluxcd.io/v1beta1`
Expand Down Expand Up @@ -3208,6 +3216,8 @@ pub mod sfn_services_k8s_aws_v1alpha1;
pub mod site_superedge_io_v1alpha1;
#[cfg(feature = "slo_koordinator_sh_v1alpha1")]
pub mod slo_koordinator_sh_v1alpha1;
#[cfg(feature = "sonataflow_org_v1alpha08")]
pub mod sonataflow_org_v1alpha08;
#[cfg(feature = "source_toolkit_fluxcd_io_v1beta1")]
pub mod source_toolkit_fluxcd_io_v1beta1;
#[cfg(feature = "source_toolkit_fluxcd_io_v1beta2")]
Expand Down
2 changes: 2 additions & 0 deletions kube-custom-resources-rs/src/sonataflow_org_v1alpha08/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod sonataflowbuilds;
pub mod sonataflowplatforms;
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --filename=./crd-catalog/kiegroup/kogito-serverless-operator/sonataflow.org/v1alpha08/sonataflowbuilds.yaml --derive=Default --derive=PartialEq
// kopium version: 0.16.2

use kube::CustomResource;
use serde::{Serialize, Deserialize};
use std::collections::BTreeMap;
use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString;

/// SonataFlowBuildSpec an abstraction over the actual build process performed by the platform.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "sonataflow.org", version = "v1alpha08", kind = "SonataFlowBuild", plural = "sonataflowbuilds")]
#[kube(namespaced)]
#[kube(status = "SonataFlowBuildStatus")]
#[kube(schema = "disabled")]
pub struct SonataFlowBuildSpec {
/// Arguments lists the command line arguments to send to the internal builder command. Depending on the build method you might set this attribute instead of BuildArgs. For example: ".spec.arguments=verbose=3". Please see the SonataFlow guides.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub arguments: Option<Vec<String>>,
/// Optional build arguments that can be set to the internal build (e.g. Docker ARG)
#[serde(default, skip_serializing_if = "Option::is_none", rename = "buildArgs")]
pub build_args: Option<Vec<SonataFlowBuildBuildArgs>>,
/// Optional environment variables to add to the internal build
#[serde(default, skip_serializing_if = "Option::is_none")]
pub envs: Option<Vec<SonataFlowBuildEnvs>>,
/// Resources optional compute resource requirements for the builder
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resources: Option<SonataFlowBuildResources>,
/// Timeout defines the Build maximum execution duration. The Build deadline is set to the Build start time plus the Timeout duration. If the Build deadline is exceeded, the Build context is canceled, and its phase set to BuildPhaseFailed.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timeout: Option<String>,
}

/// EnvVar represents an environment variable present in a Container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildBuildArgs {
/// Name of the environment variable. Must be a C_IDENTIFIER.
pub name: String,
/// Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
/// Source for the environment variable's value. Cannot be used if value is not empty.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
pub value_from: Option<SonataFlowBuildBuildArgsValueFrom>,
}

/// Source for the environment variable's value. Cannot be used if value is not empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildBuildArgsValueFrom {
/// Selects a key of a ConfigMap.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
pub config_map_key_ref: Option<SonataFlowBuildBuildArgsValueFromConfigMapKeyRef>,
/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
pub field_ref: Option<SonataFlowBuildBuildArgsValueFromFieldRef>,
/// Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
pub resource_field_ref: Option<SonataFlowBuildBuildArgsValueFromResourceFieldRef>,
/// Selects a key of a secret in the pod's namespace
#[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
pub secret_key_ref: Option<SonataFlowBuildBuildArgsValueFromSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildBuildArgsValueFromConfigMapKeyRef {
/// The key to select.
pub key: String,
/// 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<String>,
/// Specify whether the ConfigMap or its key must be defined
#[serde(default, skip_serializing_if = "Option::is_none")]
pub optional: Option<bool>,
}

/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildBuildArgsValueFromFieldRef {
/// Version of the schema the FieldPath is written in terms of, defaults to "v1".
#[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
pub api_version: Option<String>,
/// Path of the field to select in the specified API version.
#[serde(rename = "fieldPath")]
pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildBuildArgsValueFromResourceFieldRef {
/// Container name: required for volumes, optional for env vars
#[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
pub container_name: Option<String>,
/// Specifies the output format of the exposed resources, defaults to "1"
#[serde(default, skip_serializing_if = "Option::is_none")]
pub divisor: Option<IntOrString>,
/// Required: resource to select
pub resource: String,
}

/// Selects a key of a secret in the pod's namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildBuildArgsValueFromSecretKeyRef {
/// The key of the secret to select from. Must be a valid secret key.
pub key: String,
/// 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<String>,
/// Specify whether the Secret or its key must be defined
#[serde(default, skip_serializing_if = "Option::is_none")]
pub optional: Option<bool>,
}

/// EnvVar represents an environment variable present in a Container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildEnvs {
/// Name of the environment variable. Must be a C_IDENTIFIER.
pub name: String,
/// Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
/// Source for the environment variable's value. Cannot be used if value is not empty.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
pub value_from: Option<SonataFlowBuildEnvsValueFrom>,
}

/// Source for the environment variable's value. Cannot be used if value is not empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildEnvsValueFrom {
/// Selects a key of a ConfigMap.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
pub config_map_key_ref: Option<SonataFlowBuildEnvsValueFromConfigMapKeyRef>,
/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
pub field_ref: Option<SonataFlowBuildEnvsValueFromFieldRef>,
/// Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
pub resource_field_ref: Option<SonataFlowBuildEnvsValueFromResourceFieldRef>,
/// Selects a key of a secret in the pod's namespace
#[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
pub secret_key_ref: Option<SonataFlowBuildEnvsValueFromSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildEnvsValueFromConfigMapKeyRef {
/// The key to select.
pub key: String,
/// 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<String>,
/// Specify whether the ConfigMap or its key must be defined
#[serde(default, skip_serializing_if = "Option::is_none")]
pub optional: Option<bool>,
}

/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildEnvsValueFromFieldRef {
/// Version of the schema the FieldPath is written in terms of, defaults to "v1".
#[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
pub api_version: Option<String>,
/// Path of the field to select in the specified API version.
#[serde(rename = "fieldPath")]
pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildEnvsValueFromResourceFieldRef {
/// Container name: required for volumes, optional for env vars
#[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
pub container_name: Option<String>,
/// Specifies the output format of the exposed resources, defaults to "1"
#[serde(default, skip_serializing_if = "Option::is_none")]
pub divisor: Option<IntOrString>,
/// Required: resource to select
pub resource: String,
}

/// Selects a key of a secret in the pod's namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildEnvsValueFromSecretKeyRef {
/// The key of the secret to select from. Must be a valid secret key.
pub key: String,
/// 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<String>,
/// Specify whether the Secret or its key must be defined
#[serde(default, skip_serializing_if = "Option::is_none")]
pub optional: Option<bool>,
}

/// Resources optional compute resource requirements for the builder
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildResources {
/// Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
/// This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
/// This field is immutable. It can only be set for containers.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub claims: Option<Vec<SonataFlowBuildResourcesClaims>>,
/// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub limits: Option<BTreeMap<String, IntOrString>>,
/// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildResourcesClaims {
/// Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
pub name: String,
}

/// SonataFlowBuildStatus defines the observed state of SonataFlowBuild
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonataFlowBuildStatus {
/// Current phase of the build
#[serde(default, skip_serializing_if = "Option::is_none", rename = "buildPhase")]
pub build_phase: Option<String>,
/// Last error found during build
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
/// The final image tag produced by this build instance
#[serde(default, skip_serializing_if = "Option::is_none", rename = "imageTag")]
pub image_tag: Option<String>,
/// InnerBuild is a reference to an internal build object, which can be anything known only to internal builders.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "innerBuild")]
pub inner_build: Option<BTreeMap<String, serde_json::Value>>,
}

Loading

0 comments on commit 22da957

Please sign in to comment.