From 0c1f4ca96957954a5ff00b9033d959779c234c0b Mon Sep 17 00:00:00 2001 From: Razz4780 Date: Mon, 25 Nov 2024 13:48:54 +0100 Subject: [PATCH] Fix operator setup --- mirrord/operator/src/setup.rs | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/mirrord/operator/src/setup.rs b/mirrord/operator/src/setup.rs index d100a228122..7df50e33422 100644 --- a/mirrord/operator/src/setup.rs +++ b/mirrord/operator/src/setup.rs @@ -539,29 +539,22 @@ impl OperatorRole { verbs: vec!["list".to_owned(), "get".to_owned()], ..Default::default() }, + // Allow for patching replicas and environment variables. + PolicyRule { + api_groups: Some(vec!["apps".to_owned()]), + resources: Some(vec!["deployments".to_owned(), "statefulsets".to_owned()]), + verbs: vec!["patch".to_owned()], + ..Default::default() + }, + // Allow for patching replicas and environment variables. + PolicyRule { + api_groups: Some(vec!["argoproj.io".to_owned()]), + resources: Some(vec!["rollouts".to_owned()]), + verbs: vec!["patch".to_owned()], + ..Default::default() + }, ]; - if sqs_splitting || kafka_splitting { - rules.extend([ - // For SQS/Kafka controller to temporarily change deployments to use changed - // queues. - PolicyRule { - api_groups: Some(vec!["apps".to_owned()]), - resources: Some(vec!["deployments".to_owned()]), - verbs: vec!["patch".to_owned()], - ..Default::default() - }, - // For SQS/Kafka controller to temporarily change Argo Rollouts to use changed - // queues. - PolicyRule { - api_groups: Some(vec!["argoproj.io".to_owned()]), - resources: Some(vec!["rollouts".to_owned()]), - verbs: vec!["patch".to_owned()], - ..Default::default() - }, - ]); - } - if kafka_splitting { rules.extend([ PolicyRule {