Skip to content

Commit 9056ae4

Browse files
committed
set deployment tolerations too
1 parent 7900b99 commit 9056ae4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • rust/olm-deployer/src/tolerations

rust/olm-deployer/src/tolerations/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ use crate::data::get_or_create;
77

88
/// Copies the pod tolerations from the `source` to the `target`.
99
/// Does nothing if there are no tolerations or if the `target` is not
10-
/// a DaemonSet.
10+
/// a DaemonSet or a Deployment.
11+
/// Admins can configure Subscription tolerations when installing the operator
12+
/// and these need to be copied over to the objects created by the deployer.
1113
pub(super) fn maybe_copy_tolerations(
1214
source: &Deployment,
1315
target: &mut DynamicObject,
1416
target_gvk: &GroupVersionKind,
1517
) -> anyhow::Result<()> {
16-
if target_gvk.kind == "DaemonSet" {
18+
let target_kind_set = ["DaemonSet", "Deployment"];
19+
if target_kind_set.contains(&target_gvk.kind.as_str()) {
1720
if let Some(tolerations) = deployment_tolerations(source) {
1821
let path = "template/spec/tolerations".split("/");
1922
*get_or_create(target.data.pointer_mut("/spec").unwrap(), path)? = serde_json::json!(

0 commit comments

Comments
 (0)