From c9c6483f32b28a25ba0428e516eb22db5d04c17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ho=C3=9F?= Date: Sun, 12 Nov 2023 11:42:14 +0100 Subject: [PATCH] add more resources for minio/operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Hoß --- code-generator/src/catalog.rs | 1 + .../sts.min.io/v1alpha1/policybindings.yaml | 74 +++++++++++++++++++ kube-custom-resources-rs/Cargo.toml | 1 + kube-custom-resources-rs/src/lib.rs | 9 +++ .../src/sts_min_io_v1alpha1/mod.rs | 1 + .../src/sts_min_io_v1alpha1/policybindings.rs | 36 +++++++++ 6 files changed, 122 insertions(+) create mode 100644 crd-catalog/minio/operator/sts.min.io/v1alpha1/policybindings.yaml create mode 100644 kube-custom-resources-rs/src/sts_min_io_v1alpha1/mod.rs create mode 100644 kube-custom-resources-rs/src/sts_min_io_v1alpha1/policybindings.rs diff --git a/code-generator/src/catalog.rs b/code-generator/src/catalog.rs index 10b273cca..2c200d14f 100644 --- a/code-generator/src/catalog.rs +++ b/code-generator/src/catalog.rs @@ -1564,6 +1564,7 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[ license: APACHE_V2, urls: &[ "https://github.com/minio/operator/blob/master/resources/base/crds/minio.min.io_tenants.yaml", + "https://github.com/minio/operator/blob/master/resources/base/crds/sts.min.io_policybindings.yaml", ], }, UpstreamSource { diff --git a/crd-catalog/minio/operator/sts.min.io/v1alpha1/policybindings.yaml b/crd-catalog/minio/operator/sts.min.io/v1alpha1/policybindings.yaml new file mode 100644 index 000000000..dd42d1645 --- /dev/null +++ b/crd-catalog/minio/operator/sts.min.io/v1alpha1/policybindings.yaml @@ -0,0 +1,74 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + name: policybindings.sts.min.io +spec: + group: sts.min.io + names: + kind: PolicyBinding + listKind: PolicyBindingList + plural: policybindings + shortNames: + - policybinding + singular: policybinding + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.currentState + name: State + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + application: + properties: + namespace: + type: string + serviceaccount: + type: string + required: + - namespace + - serviceaccount + type: object + policies: + items: + type: string + type: array + required: + - application + - policies + type: object + status: + properties: + currentState: + type: string + usage: + nullable: true + properties: + authotizations: + format: int64 + type: integer + type: object + required: + - currentState + - usage + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/kube-custom-resources-rs/Cargo.toml b/kube-custom-resources-rs/Cargo.toml index 46e596275..f754b21be 100644 --- a/kube-custom-resources-rs/Cargo.toml +++ b/kube-custom-resources-rs/Cargo.toml @@ -295,6 +295,7 @@ source_toolkit_fluxcd_io_v1beta2 = [] sparkoperator_k8s_io_v1beta2 = [] status_gatekeeper_sh_v1beta1 = [] storage_kubeblocks_io_v1alpha1 = [] +sts_min_io_v1alpha1 = [] stunner_l7mp_io_v1alpha1 = [] submariner_io_v1alpha1 = [] templates_gatekeeper_sh_v1 = [] diff --git a/kube-custom-resources-rs/src/lib.rs b/kube-custom-resources-rs/src/lib.rs index 2bac40cff..c528f127c 100644 --- a/kube-custom-resources-rs/src/lib.rs +++ b/kube-custom-resources-rs/src/lib.rs @@ -2501,6 +2501,13 @@ apiVersion: `storage.kubeblocks.io/v1alpha1` kinds: - `StorageProvider` +## sts_min_io_v1alpha1 + +apiVersion: `sts.min.io/v1alpha1` + +kinds: +- `PolicyBinding` + ## stunner_l7mp_io_v1alpha1 apiVersion: `stunner.l7mp.io/v1alpha1` @@ -3228,6 +3235,8 @@ pub mod sparkoperator_k8s_io_v1beta2; pub mod status_gatekeeper_sh_v1beta1; #[cfg(feature = "storage_kubeblocks_io_v1alpha1")] pub mod storage_kubeblocks_io_v1alpha1; +#[cfg(feature = "sts_min_io_v1alpha1")] +pub mod sts_min_io_v1alpha1; #[cfg(feature = "stunner_l7mp_io_v1alpha1")] pub mod stunner_l7mp_io_v1alpha1; #[cfg(feature = "submariner_io_v1alpha1")] diff --git a/kube-custom-resources-rs/src/sts_min_io_v1alpha1/mod.rs b/kube-custom-resources-rs/src/sts_min_io_v1alpha1/mod.rs new file mode 100644 index 000000000..9c5506e10 --- /dev/null +++ b/kube-custom-resources-rs/src/sts_min_io_v1alpha1/mod.rs @@ -0,0 +1 @@ +pub mod policybindings; diff --git a/kube-custom-resources-rs/src/sts_min_io_v1alpha1/policybindings.rs b/kube-custom-resources-rs/src/sts_min_io_v1alpha1/policybindings.rs new file mode 100644 index 000000000..d9ad531e3 --- /dev/null +++ b/kube-custom-resources-rs/src/sts_min_io_v1alpha1/policybindings.rs @@ -0,0 +1,36 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/minio/operator/sts.min.io/v1alpha1/policybindings.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "sts.min.io", version = "v1alpha1", kind = "PolicyBinding", plural = "policybindings")] +#[kube(namespaced)] +#[kube(status = "PolicyBindingStatus")] +#[kube(schema = "disabled")] +pub struct PolicyBindingSpec { + pub application: PolicyBindingApplication, + pub policies: Vec, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct PolicyBindingApplication { + pub namespace: String, + pub serviceaccount: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct PolicyBindingStatus { + #[serde(rename = "currentState")] + pub current_state: String, + pub usage: PolicyBindingStatusUsage, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct PolicyBindingStatusUsage { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authotizations: Option, +} +