git.delta.rocks / jrsonnet / refs/commits / 33f3601e24db

difftreelog

fix shared generator condition

ywyowvrkYaroslav Bolyukin2026-01-22parent: #45c49ea.patch.diff
in: trunk

10 files changed

modifiedcmds/fleet/src/cmds/build_systems.rsdiffbeforeafterboth

no syntactic changes

modifiedcmds/fleet/src/cmds/secrets/mod.rsdiffbeforeafterboth

no syntactic changes

modifiedcrates/fleet-base/src/fleetdata.rsdiffbeforeafterboth

no syntactic changes

modifiedcrates/nix-eval/src/util.rsdiffbeforeafterboth
1use std::time::Instant;1use std::time::Instant;
22
3use anyhow::bail;3use anyhow::bail;
4use serde::Deserialize;
4use tracing::{debug, warn};5use tracing::{debug, warn};
56
6use crate::{Value, nix_go_json};7use crate::{Value, nix_go_json};
8
9#[derive(Deserialize, Debug)]
10struct Assertion {
11 assertion: bool,
12 message: String,
13}
714
8#[tracing::instrument(level = "info", skip(val))]15#[tracing::instrument(level = "info", skip(val))]
9pub async fn assert_warn(action: &str, val: &Value) -> anyhow::Result<()> {16pub async fn assert_warn(action: &str, val: &Value) -> anyhow::Result<()> {
10 let before_errors = Instant::now();17 let before_errors = Instant::now();
11 let errors: Vec<String> = nix_go_json!(val.errors);18 let errors: Vec<String> = nix_go_json!(val.errors);
19 // let assertions: Vec<Assertion> = nix_go_json!(val.assertions);
12 debug!("errors evaluation took {:?}", before_errors.elapsed());20 debug!("errors evaluation took {:?} {errors:?} ", before_errors.elapsed());
13 if !errors.is_empty() {21 if !errors.is_empty() {
14 bail!(22 bail!(
15 "failed with error{}{}",23 "failed with error{}{}",
modifiedcrates/nixlike/Cargo.tomldiffbeforeafterboth
7[dependencies]7[dependencies]
8thiserror.workspace = true8thiserror.workspace = true
99
10itertools = "0.14.0"
10linked-hash-map = "0.5.6"11linked-hash-map = "0.5.6"
11peg = "0.8.5"12peg = "0.8.5"
12ron = "0.11.0"13ron = "0.11.0"
13serde = { version = "1.0.219", features = ["derive"] }14serde = { version = "1.0.219", features = ["derive"] }
14serde-transcode = "1.1.1"15serde-transcode = "1.1.1"
15serde_json = "1.0.140"16serde_json = "1.0.140"
16itertools = "0.14.0"
1717
modifiedlib/default.nixdiffbeforeafterboth
152 mkAskPass =152 mkAskPass =
153 { prompt ? "Secret value", part ? "secret" }:153 {
154 prompt ? "Secret value",
155 part ? "secret",
156 }:
154 (157 (
155 {158 {
modifiedlib/flakePart.nixdiffbeforeafterboth

no syntactic changes

modifiedmodules/nixos.nixdiffbeforeafterboth

no syntactic changes

modifiedmodules/nixos/secrets.nixdiffbeforeafterboth
155 assertions = mapAttrsToList (name: secret: let156 assertions = mapAttrsToList (
157 name: secret:
158 let
156 hasSharedDefinition = fleetConfiguration.secrets ? name;159 hasSharedDefinition = fleetConfiguration.secrets ? ${name};
157 in {160 in
161 {
158 assertion = (secret.definition.generator == "shared") == hasSharedDefinition && hasSharedDefinition -> (elem host._module.args.name fleetConfiguration.secrets.${name}.expectedOwners);162 assertion =
163 (secret.definition.generator == "shared") == hasSharedDefinition
164 && (
165 hasSharedDefinition
166 -> (elem host._module.args.name fleetConfiguration.secrets.${name}.expectedOwners)
167 );
159 message = if hasSharedDefinition then"secret ${name} has host-specific secret generator, secrets with host-specific generators can not have shared generator in fleet configuration"168 message =
169 if hasSharedDefinition then
170 "secret ${name} has host-specific secret generator, secrets with host-specific generators can not have shared generator in fleet configuration"
modifiedmodules/nixos/top-level.nixdiffbeforeafterboth
2 pkgs,2 pkgs,
3 config,3 config,
4 lib,4 lib,
5 ...
5}:6}:
6let7let
7 inherit (lib.strings) optionalString;8 inherit (lib.strings) optionalString;