chore: Consolidate error enums and use expect where possible - #1017
Open
adwk67 wants to merge 8 commits into
Open
chore: Consolidate error enums and use expect where possible#1017adwk67 wants to merge 8 commits into
adwk67 wants to merge 8 commits into
Conversation
12 tasks
siegfriedweber
requested changes
Sep 9, 2026
| /// compute the name from the raw cluster identity when fetching the stored `Listener`s that the | ||
| /// discovery `ConfigMap` is built from. | ||
| /// | ||
| /// The returned ListenerName is a lowercase RFC 1035 label name (checked by a unit test). |
Member
There was a problem hiding this comment.
With
const _: () = assert!(
QualifiedRoleGroupName::MAX_LENGTH + BOOTSTRAP_SUFFIX.len() <= RFC_1035_LABEL_MAX_LENGTH,
"The string `<qualified_role_group_name>-bootstrap` must not exceed the limit of an \
RFC 1035 label name."
);you could statically ensure the maximum length for an RFC 1035 label name.
Comment on lines
740
to
752
| /// Adds the Vector log-aggregation sidecar container, when the Vector agent is enabled. | ||
| /// | ||
| /// Whether Vector is enabled, the per-container log config and the (validated) aggregator | ||
| /// discovery `ConfigMap` name are resolved up-front in | ||
| /// [`ValidatedLogging`]. The container mounts the | ||
| /// static `vector.yaml` from the `config` volume and is driven by the env vars the | ||
| /// [`vector_container`] sets. | ||
| /// The [`ContainerName`] for a role container, derived from its `Display` name so the | ||
| /// Vector sidecar's container name always matches that container's logging-config key. | ||
| fn container_name(container: impl std::fmt::Display) -> ContainerName { | ||
| ContainerName::from_str(&container.to_string()) | ||
| .expect("a container enum variant is always a valid ContainerName") | ||
| } |
Member
There was a problem hiding this comment.
I stumbled over this function because you used it above.
If anyone is ever looking for an argument against using expect, they've found the perfect one here. We need to fix this before we declare the smooth-operator ticket complete.
And the comment obviously belongs to the next function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of stackabletech/issues#883
Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecationlabel & add to the deprecation scheduletype/experimentallabel & add to the experimental features tracker