Skip to content

Commit

Permalink
add change-metrics/monocle-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 4, 2023
1 parent 538005b commit 1c6c397
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ Files: crd-catalog/cert-manager/cert-manager/*
Copyright: The cert-manager/cert-manager Authors
License: Apache-2.0

Files: crd-catalog/change-metrics/monocle-operator/*
Copyright: The change-metrics/monocle-operator Authors
License: Apache-2.0

Files: crd-catalog/chaos-mesh/chaos-mesh/*
Copyright: The chaos-mesh/chaos-mesh Authors
License: Apache-2.0
Expand Down
7 changes: 7 additions & 0 deletions code-generator/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,13 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[
"https://github.com/cert-manager/cert-manager/blob/master/deploy/crds/crd-orders.yaml",
],
},
UpstreamSource {
project_name: "change-metrics/monocle-operator",
license: APACHE_V2,
urls: &[
"https://github.com/change-metrics/monocle-operator/blob/master/config/crd/bases/monocle.monocle.change-metrics.io_monocles.yaml",
],
},
UpstreamSource {
project_name: "chaos-mesh/chaos-mesh",
license: APACHE_V2,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
name: monocles.monocle.monocle.change-metrics.io
spec:
group: monocle.monocle.change-metrics.io
names:
kind: Monocle
listKind: MonocleList
plural: monocles
singular: monocle
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Monocle is the Schema for the monocles 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: MonocleSpec defines the desired state of Monocle
properties:
image:
default: quay.io/change-metrics/monocle:1.9.0
description: Monocle container image
type: string
publicURL:
description: Public URL to access the Monocle API
pattern: ^https?:\/\/.+$
type: string
route:
description: If set a Route (Openshift) resource will be spawned
properties:
host:
description: Hostname to use for setting the Route
type: string
labels:
additionalProperties:
type: string
description: Labels to add to the Route resource
type: object
type: object
storageClassName:
description: Storage class name when creating the PVC
type: string
storageSize:
description: Initial Storage Size for the database storage
type: string
type: object
status:
description: MonocleStatus defines the observed state of Monocle
properties:
monocle-api:
type: string
monocle-crawler:
type: string
monocle-elastic:
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
1 change: 1 addition & 0 deletions kube-custom-resources-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ model_kubedl_io_v1alpha1 = []
monitoring_coreos_com_v1 = []
monitoring_coreos_com_v1alpha1 = []
monitoring_coreos_com_v1beta1 = []
monocle_monocle_change_metrics_io_v1alpha1 = []
mq_services_k8s_aws_v1alpha1 = []
multicluster_x_k8s_io_v1alpha1 = []
mutations_gatekeeper_sh_v1 = []
Expand Down
2 changes: 2 additions & 0 deletions kube-custom-resources-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ pub mod monitoring_coreos_com_v1;
pub mod monitoring_coreos_com_v1alpha1;
#[cfg(feature = "monitoring_coreos_com_v1beta1")]
pub mod monitoring_coreos_com_v1beta1;
#[cfg(feature = "monocle_monocle_change_metrics_io_v1alpha1")]
pub mod monocle_monocle_change_metrics_io_v1alpha1;
#[cfg(feature = "mq_services_k8s_aws_v1alpha1")]
pub mod mq_services_k8s_aws_v1alpha1;
#[cfg(feature = "multicluster_x_k8s_io_v1alpha1")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod monocles;
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --filename ./crd-catalog/change-metrics/monocle-operator/monocle.monocle.change-metrics.io/v1alpha1/monocles.yaml
// kopium version: 0.16.1

use kube::CustomResource;
use serde::{Serialize, Deserialize};
use std::collections::BTreeMap;

/// MonocleSpec defines the desired state of Monocle
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug)]
#[kube(group = "monocle.monocle.change-metrics.io", version = "v1alpha1", kind = "Monocle", plural = "monocles")]
#[kube(namespaced)]
#[kube(status = "MonocleStatus")]
#[kube(schema = "disabled")]
pub struct MonocleSpec {
/// Monocle container image
#[serde(default, skip_serializing_if = "Option::is_none")]
pub image: Option<String>,
/// Public URL to access the Monocle API
#[serde(default, skip_serializing_if = "Option::is_none", rename = "publicURL")]
pub public_url: Option<String>,
/// If set a Route (Openshift) resource will be spawned
#[serde(default, skip_serializing_if = "Option::is_none")]
pub route: Option<MonocleRoute>,
/// Storage class name when creating the PVC
#[serde(default, skip_serializing_if = "Option::is_none", rename = "storageClassName")]
pub storage_class_name: Option<String>,
/// Initial Storage Size for the database storage
#[serde(default, skip_serializing_if = "Option::is_none", rename = "storageSize")]
pub storage_size: Option<String>,
}

/// If set a Route (Openshift) resource will be spawned
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct MonocleRoute {
/// Hostname to use for setting the Route
#[serde(default, skip_serializing_if = "Option::is_none")]
pub host: Option<String>,
/// Labels to add to the Route resource
#[serde(default, skip_serializing_if = "Option::is_none")]
pub labels: Option<BTreeMap<String, String>>,
}

/// MonocleStatus defines the observed state of Monocle
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct MonocleStatus {
#[serde(default, skip_serializing_if = "Option::is_none", rename = "monocle-api")]
pub monocle_api: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "monocle-crawler")]
pub monocle_crawler: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "monocle-elastic")]
pub monocle_elastic: Option<String>,
}

0 comments on commit 1c6c397

Please sign in to comment.