From c4e7ea44370e21889452ac53a09816a193737b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ho=C3=9F?= Date: Sun, 11 Feb 2024 13:08:00 +0100 Subject: [PATCH] add redhat-cop/keepalived-operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Hoß --- .reuse/dep5 | 4 + code-generator/src/catalog.rs | 7 + .../v1alpha1/keepalivedgroups.args | 1 + .../v1alpha1/keepalivedgroups.yaml | 146 ++++++++++++++++++ kube-custom-resources-rs/Cargo.toml | 1 + kube-custom-resources-rs/src/lib.rs | 7 + .../src/redhatcop_redhat_io/mod.rs | 1 + .../v1alpha1/keepalivedgroups.rs | 96 ++++++++++++ .../src/redhatcop_redhat_io/v1alpha1/mod.rs | 1 + 9 files changed, 264 insertions(+) create mode 100644 crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.args create mode 100644 crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.yaml create mode 100644 kube-custom-resources-rs/src/redhatcop_redhat_io/mod.rs create mode 100644 kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/keepalivedgroups.rs create mode 100644 kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/mod.rs diff --git a/.reuse/dep5 b/.reuse/dep5 index 806611696..91f277b1d 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -859,6 +859,10 @@ Files: crd-catalog/reddec/keycloak-ext-operator/* Copyright: The reddec/keycloak-ext-operator Authors License: Apache-2.0 +Files: crd-catalog/redhat-cop/keepalived-operator/* +Copyright: The redhat-cop/keepalived-operator Authors +License: Apache-2.0 + Files: crd-catalog/redhat-cop/namespace-configuration-operator/* Copyright: The redhat-cop/namespace-configuration-operator Authors License: Apache-2.0 diff --git a/code-generator/src/catalog.rs b/code-generator/src/catalog.rs index 3019e0e09..0180cbea9 100644 --- a/code-generator/src/catalog.rs +++ b/code-generator/src/catalog.rs @@ -2270,6 +2270,13 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[ "https://github.com/reddec/keycloak-ext-operator/blob/master/config/crd/bases/keycloak.k8s.reddec.net_keycloakclients.yaml", ], }, + UpstreamSource { + project_name: "redhat-cop/keepalived-operator", + license: APACHE_V2, + urls: &[ + "https://github.com/redhat-cop/keepalived-operator/blob/master/config/crd/bases/redhatcop.redhat.io_keepalivedgroups.yaml", + ], + }, UpstreamSource { project_name: "redhat-cop/namespace-configuration-operator", license: APACHE_V2, diff --git a/crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.args b/crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.args new file mode 100644 index 000000000..7ab47510b --- /dev/null +++ b/crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.args @@ -0,0 +1 @@ +--derive=PartialEq diff --git a/crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.yaml b/crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.yaml new file mode 100644 index 000000000..7bd0a009d --- /dev/null +++ b/crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.yaml @@ -0,0 +1,146 @@ +apiVersion: "apiextensions.k8s.io/v1" +kind: "CustomResourceDefinition" +metadata: + annotations: + controller-gen.kubebuilder.io/version: "v0.9.0" + name: "keepalivedgroups.redhatcop.redhat.io" +spec: + group: "redhatcop.redhat.io" + names: + kind: "KeepalivedGroup" + listKind: "KeepalivedGroupList" + plural: "keepalivedgroups" + singular: "keepalivedgroup" + scope: "Namespaced" + versions: + - name: "v1alpha1" + schema: + openAPIV3Schema: + description: "KeepalivedGroup is the Schema for the keepalivedgroups 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: "KeepalivedGroupSpec defines the desired state of KeepalivedGroup" + properties: + blacklistRouterIDs: + description: "// +kubebuilder:validation:UniqueItems=true" + items: + type: "integer" + type: "array" + x-kubernetes-list-type: "set" + daemonsetPodAnnotations: + additionalProperties: + type: "string" + type: "object" + x-kubernetes-map-type: "granular" + daemonsetPodPriorityClassName: + type: "string" + image: + default: "registry.redhat.io/openshift4/ose-keepalived-ipfailover" + description: "//+kubebuilder:validation:Optional" + type: "string" + interface: + type: "string" + interfaceFromIP: + format: "ipv4" + type: "string" + nodeSelector: + additionalProperties: + type: "string" + type: "object" + x-kubernetes-map-type: "granular" + passwordAuth: + description: "PasswordAuth references a Kubernetes secret to extract the password for VRRP authentication" + properties: + secretKey: + default: "password" + type: "string" + secretRef: + description: "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace." + 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" + required: + - "secretRef" + type: "object" + unicastEnabled: + type: "boolean" + verbatimConfig: + additionalProperties: + type: "string" + type: "object" + x-kubernetes-map-type: "granular" + required: + - "image" + - "interface" + type: "object" + status: + description: "KeepalivedGroupStatus defines the observed state of KeepalivedGroup" + properties: + conditions: + description: "INSERT ADDITIONAL STATUS FIELD - define observed state of cluster" + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable." + format: "date-time" + type: "string" + message: + description: "message is a human readable message indicating details about the transition. This may be an empty string." + maxLength: 32768 + type: "string" + observedGeneration: + description: "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance." + format: "int64" + minimum: 0.0 + type: "integer" + reason: + description: "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty." + maxLength: 1024 + minLength: 1 + pattern: "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$" + type: "string" + status: + description: "status of the condition, one of True, False, Unknown." + enum: + - "True" + - "False" + - "Unknown" + type: "string" + type: + description: "type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)" + maxLength: 316 + pattern: "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$" + type: "string" + required: + - "lastTransitionTime" + - "message" + - "reason" + - "status" + - "type" + type: "object" + type: "array" + x-kubernetes-list-map-keys: + - "type" + x-kubernetes-list-type: "map" + routerIDs: + additionalProperties: + type: "integer" + type: "object" + x-kubernetes-map-type: "granular" + 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 d46f0fe72..4b57d6caa 100644 --- a/kube-custom-resources-rs/Cargo.toml +++ b/kube-custom-resources-rs/Cargo.toml @@ -260,6 +260,7 @@ quota_openshift_io = [] ray_io = [] rbacmanager_reactiveops_io = [] rds_services_k8s_aws = [] +redhatcop_redhat_io = [] registry_apicur_io = [] registry_devfile_io = [] reliablesyncs_kubeedge_io = [] diff --git a/kube-custom-resources-rs/src/lib.rs b/kube-custom-resources-rs/src/lib.rs index 45fa68b7f..e5a95ac19 100644 --- a/kube-custom-resources-rs/src/lib.rs +++ b/kube-custom-resources-rs/src/lib.rs @@ -2091,6 +2091,11 @@ apiVersion `rds.services.k8s.aws/v1alpha1`: - `DBSubnetGroup` - `GlobalCluster` +## redhatcop_redhat_io + +apiVersion `redhatcop.redhat.io/v1alpha1`: +- `KeepalivedGroup` + ## registry_apicur_io apiVersion `registry.apicur.io/v1`: @@ -3067,6 +3072,8 @@ pub mod ray_io; pub mod rbacmanager_reactiveops_io; #[cfg(feature = "rds_services_k8s_aws")] pub mod rds_services_k8s_aws; +#[cfg(feature = "redhatcop_redhat_io")] +pub mod redhatcop_redhat_io; #[cfg(feature = "registry_apicur_io")] pub mod registry_apicur_io; #[cfg(feature = "registry_devfile_io")] diff --git a/kube-custom-resources-rs/src/redhatcop_redhat_io/mod.rs b/kube-custom-resources-rs/src/redhatcop_redhat_io/mod.rs new file mode 100644 index 000000000..32a5a9d4f --- /dev/null +++ b/kube-custom-resources-rs/src/redhatcop_redhat_io/mod.rs @@ -0,0 +1 @@ +pub mod v1alpha1; diff --git a/kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/keepalivedgroups.rs b/kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/keepalivedgroups.rs new file mode 100644 index 000000000..494661f97 --- /dev/null +++ b/kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/keepalivedgroups.rs @@ -0,0 +1,96 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/redhat-cop/keepalived-operator/redhatcop.redhat.io/v1alpha1/keepalivedgroups.yaml --derive=PartialEq +// kopium version: 0.16.5 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// KeepalivedGroupSpec defines the desired state of KeepalivedGroup +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)] +#[kube(group = "redhatcop.redhat.io", version = "v1alpha1", kind = "KeepalivedGroup", plural = "keepalivedgroups")] +#[kube(namespaced)] +#[kube(status = "KeepalivedGroupStatus")] +#[kube(schema = "disabled")] +pub struct KeepalivedGroupSpec { + /// // +kubebuilder:validation:UniqueItems=true + #[serde(default, skip_serializing_if = "Option::is_none", rename = "blacklistRouterIDs")] + pub blacklist_router_i_ds: Option>, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "daemonsetPodAnnotations")] + pub daemonset_pod_annotations: Option>, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "daemonsetPodPriorityClassName")] + pub daemonset_pod_priority_class_name: Option, + /// //+kubebuilder:validation:Optional + pub image: String, + pub interface: String, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "interfaceFromIP")] + pub interface_from_ip: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeSelector")] + pub node_selector: Option>, + /// PasswordAuth references a Kubernetes secret to extract the password for VRRP authentication + #[serde(default, skip_serializing_if = "Option::is_none", rename = "passwordAuth")] + pub password_auth: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "unicastEnabled")] + pub unicast_enabled: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "verbatimConfig")] + pub verbatim_config: Option>, +} + +/// PasswordAuth references a Kubernetes secret to extract the password for VRRP authentication +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct KeepalivedGroupPasswordAuth { + #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKey")] + pub secret_key: Option, + /// LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. + #[serde(rename = "secretRef")] + pub secret_ref: KeepalivedGroupPasswordAuthSecretRef, +} + +/// LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct KeepalivedGroupPasswordAuthSecretRef { + /// 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, +} + +/// KeepalivedGroupStatus defines the observed state of KeepalivedGroup +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct KeepalivedGroupStatus { + /// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "routerIDs")] + pub router_i_ds: Option>, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct KeepalivedGroupStatusConditions { + /// lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + #[serde(rename = "lastTransitionTime")] + pub last_transition_time: String, + /// message is a human readable message indicating details about the transition. This may be an empty string. + pub message: String, + /// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")] + pub observed_generation: Option, + /// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + pub reason: String, + /// status of the condition, one of True, False, Unknown. + pub status: KeepalivedGroupStatusConditionsStatus, + /// type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + #[serde(rename = "type")] + pub r#type: String, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum KeepalivedGroupStatusConditionsStatus { + True, + False, + Unknown, +} + diff --git a/kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/mod.rs b/kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/mod.rs new file mode 100644 index 000000000..00922beff --- /dev/null +++ b/kube-custom-resources-rs/src/redhatcop_redhat_io/v1alpha1/mod.rs @@ -0,0 +1 @@ +pub mod keepalivedgroups;