1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// 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>,
}