Skip to content

Commit

Permalink
add redhat-cop/keepalived-operator
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Hoß <[email protected]>
  • Loading branch information
sebhoss committed Feb 11, 2024
1 parent 1d2cb85 commit d2d64e3
Show file tree
Hide file tree
Showing 9 changed files with 264 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--derive=PartialEq
Original file line number Diff line number Diff line change
@@ -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: {}
1 change: 1 addition & 0 deletions kube-custom-resources-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
7 changes: 7 additions & 0 deletions kube-custom-resources-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down Expand Up @@ -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")]
Expand Down
1 change: 1 addition & 0 deletions kube-custom-resources-rs/src/redhatcop_redhat_io/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod v1alpha1;
Original file line number Diff line number Diff line change
@@ -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<Vec<i64>>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "daemonsetPodAnnotations")]
pub daemonset_pod_annotations: Option<BTreeMap<String, String>>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "daemonsetPodPriorityClassName")]
pub daemonset_pod_priority_class_name: Option<String>,
/// //+kubebuilder:validation:Optional
pub image: String,
pub interface: String,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "interfaceFromIP")]
pub interface_from_ip: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeSelector")]
pub node_selector: Option<BTreeMap<String, String>>,
/// 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<KeepalivedGroupPasswordAuth>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "unicastEnabled")]
pub unicast_enabled: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "verbatimConfig")]
pub verbatim_config: Option<BTreeMap<String, String>>,
}

/// 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<String>,
/// 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<String>,
}

/// 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<Vec<KeepalivedGroupStatusConditions>>,
#[serde(default, skip_serializing_if = "Option::is_none", rename = "routerIDs")]
pub router_i_ds: Option<BTreeMap<String, i64>>,
}

/// 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<i64>,
/// 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,
}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod keepalivedgroups;

0 comments on commit d2d64e3

Please sign in to comment.