Skip to content

Commit 7971ce5

Browse files
committed
chore(operator): Fix and adjust doc comments
1 parent c99705d commit 7971ce5

File tree

1 file changed

+17
-14
lines changed
  • crates/stackable-operator/src/kvp/label

1 file changed

+17
-14
lines changed

crates/stackable-operator/src/kvp/label/mod.rs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! This module provides various types and functions to construct valid
22
//! Kubernetes labels. Labels are key/value pairs, where the key must meet
3-
//! certain requirementens regarding length and character set. The value can
3+
//! certain requirements regarding length and character set. The value can
44
//! contain a limited set of ASCII characters.
55
//!
66
//! Additionally, the [`Label`] struct provides various helper functions to
@@ -156,26 +156,28 @@ impl Label {
156156
self.0
157157
}
158158

159-
/// Creates the `app.kubernetes.io/component` label with `role` as the
160-
/// value. This function will return an error if `role` violates the required
161-
/// Kubernetes restrictions.
159+
/// Creates the `app.kubernetes.io/component` label with `role` as the value.
160+
///
161+
/// This function will return an error if `role` violates the required Kubernetes restrictions.
162162
pub fn component(component: &str) -> Result<Self, LabelError> {
163163
let kvp = KeyValuePair::try_from((K8S_APP_COMPONENT_KEY, component))?;
164164
Ok(Self(kvp))
165165
}
166166

167-
/// Creates the `app.kubernetes.io/role-group` label with `role_group` as
168-
/// the value. This function will return an error if `role_group` violates
169-
/// the required Kubernetes restrictions.
167+
/// Creates the `app.kubernetes.io/role-group` label with `role_group` as the value.
168+
///
169+
/// This function will return an error if `role_group` violates the required Kubernetes
170+
/// restrictions.
170171
pub fn role_group(role_group: &str) -> Result<Self, LabelError> {
171172
let kvp = KeyValuePair::try_from((K8S_APP_ROLE_GROUP_KEY, role_group))?;
172173
Ok(Self(kvp))
173174
}
174175

175-
/// Creates the `app.kubernetes.io/managed-by` label with the formated
176-
/// full controller name based on `operator_name` and `controller_name` as
177-
/// the value. This function will return an error if the formatted controller
178-
/// name violates the required Kubernetes restrictions.
176+
/// Creates the `app.kubernetes.io/managed-by` label with the formatted full controller name
177+
/// based on `operator_name` and `controller_name` as the value.
178+
///
179+
/// This function will return an error if the formatted controller name violates the required
180+
/// Kubernetes restrictions.
179181
pub fn managed_by(operator_name: &str, controller_name: &str) -> Result<Self, LabelError> {
180182
let kvp = KeyValuePair::try_from((
181183
K8S_APP_MANAGED_BY_KEY,
@@ -184,9 +186,10 @@ impl Label {
184186
Ok(Self(kvp))
185187
}
186188

187-
/// Creates the `app.kubernetes.io/version` label with `version` as the
188-
/// value. This function will return an error if `role_group` violates the
189-
/// required Kubernetes restrictions.
189+
/// Creates the `app.kubernetes.io/version` label with `version` as the value.
190+
///
191+
/// This function will return an error if `version` violates the required Kubernetes
192+
/// restrictions.
190193
pub fn version(version: &str) -> Result<Self, LabelError> {
191194
// NOTE (Techassi): Maybe use semver::Version
192195
let kvp = KeyValuePair::try_from((K8S_APP_VERSION_KEY, version))?;

0 commit comments

Comments
 (0)