Skip to content

Commit

Permalink
Merge branch 'main' into operator-client-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 authored Nov 26, 2024
2 parents 81fd35f + 7f09ee5 commit ad547c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
1 change: 1 addition & 0 deletions changelog.d/+scaledown-prep.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated `RolloutSpec` and operator setup.
1 change: 1 addition & 0 deletions mirrord/kube/src/api/kubernetes/rollout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub struct RolloutStatus {
#[derive(Clone, Debug, Deserialize, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RolloutSpec {
pub replicas: Option<i32>,
pub selector: LabelSelector,
#[serde(deserialize_with = "rollout_pod_spec")]
pub template: Option<PodTemplateSpec>,
Expand Down
35 changes: 14 additions & 21 deletions mirrord/operator/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ad547c9

Please sign in to comment.