Skip to content

Commit

Permalink
warning when target is not a deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 committed Nov 3, 2023
1 parent 59ebe29 commit 1be0cfd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion mirrord/operator/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use mirrord_auth::{
certificate::Certificate, credential_store::CredentialStoreSync, error::AuthenticationError,
};
use mirrord_config::{
feature::network::incoming::ConcurrentSteal, target::TargetConfig, LayerConfig,
feature::network::incoming::ConcurrentSteal,
target::{Target, TargetConfig},
LayerConfig,
};
use mirrord_kube::{
api::kubernetes::{create_kube_api, get_k8s_resource_api},
Expand Down Expand Up @@ -245,6 +247,16 @@ impl OperatorApi {

let target_to_connect = if config.feature.copy_target.enabled {
let mut copy_progress = progress.subtask("copying target");

if config.feature.copy_target.scale_down {
let is_deployment = matches!(config.target.path, Some(Target::Deployment(..)));
if !is_deployment {
progress.warning(
"cannot scale down while copying target - target is not a deployment",
)
}
}

let copied = operator_api
.copy_target(&metadata, raw_target, config.feature.copy_target.scale_down)
.await?;
Expand Down

0 comments on commit 1be0cfd

Please sign in to comment.