From 18a150f73ff4ecc4530f547af83694679b1d791e Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 7 Aug 2016 19:44:17 +0200 Subject: [PATCH] Jobset: Don't display properties without a spec While in general this wouldn't be a problem, because the values would be sent out as-is using the API it will become a problem as soon as type "secret" is used in a property and that property is no longer existing in the spec. It would then spit out all the secrets where there is no specification for the type, which is definitely not what we want. Signed-off-by: aszlig --- src/lib/Hydra/Controller/Jobset.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index df558e984..de74a4d97 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -253,6 +253,10 @@ sub cleanProperties { ); } else { foreach my $prop (keys %$props) { + unless ($spec->{properties}->{$prop}) { + delete $props->{$prop}; + next; + } $props->{$prop} = cleanProperty( $c, $spec->{properties}->{$prop}, $props->{$prop} );