Skip to content

Commit

Permalink
fix: use labels instead of hardcoded indexes
Browse files Browse the repository at this point in the history
This PR makes two changes.

First we use labels to track which stateful sets and services should
belong to a ceramic configuration. This changes from the previous logic
that hardcoded indexes and deleted resources blindly based on those
indexes. This reduces the noise in the operator logs as it only does the
work that is needed vs always assuming there are resources to delete.

Second this changes both network and simulations to not watch nearly as
many resources. This greatly reduces the number of reconcile loops we
run and thus the amount of work the operator needs to do. And we still get
low latency when a network or simulation is changed.

These changes combined should improve the stability of the keramik
operator.
  • Loading branch information
nathanielc committed Feb 6, 2024
1 parent 2fee683 commit 28a7b6e
Show file tree
Hide file tree
Showing 51 changed files with 317 additions and 268 deletions.
12 changes: 12 additions & 0 deletions operator/src/labels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@ pub fn managed_labels() -> Option<BTreeMap<String, String>> {
"keramik".to_owned(),
)]))
}
/// Labels that indicate the resource is managed by the keramik operator extend with custom labels.
pub fn managed_labels_extend(
extend_labels: Option<BTreeMap<String, String>>,
) -> Option<BTreeMap<String, String>> {
if let Some(extend_labels) = extend_labels {
let mut labels = managed_labels().unwrap();
labels.extend(extend_labels);
Some(labels)
} else {
managed_labels()
}
}
Loading

0 comments on commit 28a7b6e

Please sign in to comment.