diff options
author | 2024-12-14 19:25:31 -0800 | |
---|---|---|
committer | 2024-12-14 19:25:31 -0800 | |
commit | 17b50c1f823a1fd4fad052684bb9ced6f8d179f4 (patch) | |
tree | 367d35db6c378690055e344925e29f2449b3b695 | |
parent | aeb99e4bb33569839ea0b33ef56c8daaf117f69a (diff) | |
download | restic-operator-17b50c1f823a1fd4fad052684bb9ced6f8d179f4.tar.gz restic-operator-17b50c1f823a1fd4fad052684bb9ced6f8d179f4.tar.zst restic-operator-17b50c1f823a1fd4fad052684bb9ced6f8d179f4.zip |
fix: add default args when none are provided
-rw-r--r-- | src/jobspec.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jobspec.rs b/src/jobspec.rs index 212172c..0907f91 100644 --- a/src/jobspec.rs +++ b/src/jobspec.rs @@ -34,6 +34,11 @@ impl BackupJobSpec { let env = fill_env(backup, &mut rpcfg); let (volume_mounts, volumes) = fill_volume_mounts(backup, config_name); + // If no args or command is provided, default args to "backup" + if rpcfg.args.is_none() && rpcfg.command.is_none() { + rpcfg.args = Some(vec!["backup".to_owned()]); + } + Self { image, image_pull_policy: rpcfg.image_pull_policy.take(), |