git.delta.rocks / jrsonnet / refs/commits / 602c928e0efd

difftreelog

feat regenerate --skip-hosts argument

Yaroslav Bolyukin2024-12-03parent: #347bd4a.patch.diff
in: trunk

1 file changed

modifiedcmds/fleet/src/cmds/secrets/mod.rsdiffbeforeafterboth
114 /// regeneration114 /// regeneration
115 #[clap(long)]115 #[clap(long)]
116 prefer_identities: Vec<String>,116 prefer_identities: Vec<String>,
117 /// Only regenerate shared secrets
118 #[clap(long)]
119 skip_hosts: bool,
117 },120 },
118 List {},121 List {},
119 Edit {122 Edit {
677 config.replace_shared(name, updated);680 config.replace_shared(name, updated);
678 }681 }
679 Secret::Regenerate { prefer_identities } => {682 Secret::Regenerate {
683 prefer_identities,
684 skip_hosts,
685 } => {
680 info!("checking for secrets to regenerate");686 info!("checking for secrets to regenerate");
681 let stored_shared_set = config.list_shared().into_iter().collect::<HashSet<_>>();687 let stored_shared_set = config.list_shared().into_iter().collect::<HashSet<_>>();
713 config.replace_shared(missing.to_string(), shared)719 config.replace_shared(missing.to_string(), shared)
714 }720 }
715 }721 }
722 if !skip_hosts {
716 let hosts_batch = None;723 let hosts_batch = None;
717 for host in config.list_hosts().await? {724 for host in config.list_hosts().await? {
718 if opts.should_skip(&host).await? {725 if opts.should_skip(&host).await? {
780 }789 }
781 }790 }
782 }791 }
792 }
783 let mut to_remove = Vec::new();793 let mut to_remove = Vec::new();
784 for name in &stored_shared_set {794 for name in &stored_shared_set {
785 info!("updating secret: {name}");795 info!("updating secret: {name}");