kcr_edp_epam_com 3.20260531.121040

Kubernetes Custom Resource Bindings
Documentation
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/epam/edp-sonar-operator/edp.epam.com/v1alpha1/sonars.yaml
// kopium version: 0.23.0

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
}

use self::prelude::*;

/// SonarSpec defines the desired state of Sonar.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "edp.epam.com", version = "v1alpha1", kind = "Sonar", plural = "sonars")]
#[kube(namespaced)]
#[kube(status = "SonarStatus")]
#[kube(schema = "disabled")]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct SonarSpec {
    /// DefaultPermissionTemplate is the name of the default permission template.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "defaultPermissionTemplate")]
    pub default_permission_template: Option<String>,
    /// Secret is the name of the k8s object Secret related to sonar.
    /// Secret should contain a user field with a sonar username and a password field with a sonar password.
    /// Pass the token in the user field and leave the password field empty for token authentication.
    pub secret: String,
    /// Settings specify which settings should be configured.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub settings: Option<Vec<SonarSettings>>,
    /// Url is the url of sonar instance.
    pub url: String,
}

/// SonarSetting defines the setting of sonar.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonarSettings {
    /// Setting field values. To set several values, the parameter must be called once for each value.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldValues")]
    pub field_values: Option<BTreeMap<String, String>>,
    /// Key is the key of the setting.
    pub key: String,
    /// Value is the value of the setting.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    /// ValueRef is a reference to a key in a ConfigMap or a Secret.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueRef")]
    pub value_ref: Option<SonarSettingsValueRef>,
    /// Setting multi value. To set several values, the parameter must be called once for each value.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// ValueRef is a reference to a key in a ConfigMap or a Secret.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonarSettingsValueRef {
    /// Selects a key of a ConfigMap.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
    pub config_map_key_ref: Option<SonarSettingsValueRefConfigMapKeyRef>,
    /// Selects a key of a secret.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
    pub secret_key_ref: Option<SonarSettingsValueRefSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonarSettingsValueRefConfigMapKeyRef {
    /// The key to select.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// Selects a key of a secret.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonarSettingsValueRefSecretKeyRef {
    /// The key of the secret to select from.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// SonarStatus defines the observed state of Sonar.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SonarStatus {
    /// Connected shows if operator is connected to sonar.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub connected: Option<bool>,
    /// Error represents error message if something went wrong.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// ProcessedSettings shows which settings were processed.
    /// It is used to compare the current settings with the settings that were processed
    /// to unset the settings that are not in the current settings.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "processedSettings")]
    pub processed_settings: Option<String>,
    /// Value is status of sonar instance.
    /// Possible values:
    /// GREEN: SonarQube is fully operational
    /// YELLOW: SonarQube is usable, but it needs attention in order to be fully operational
    /// RED: SonarQube is not operational
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}