From 89347db4dfa53d433015db742f83c1c21a90d115 Mon Sep 17 00:00:00 2001 From: Stephane Selim Date: Thu, 5 Dec 2024 18:47:09 +0100 Subject: [PATCH] output envconfig name if missing instead of generic extra resource name Signed-off-by: Stephane Selim --- fn.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fn.go b/fn.go index 551c94c..eb28a85 100644 --- a/fn.go +++ b/fn.go @@ -141,14 +141,15 @@ func getSelectedEnvConfigs(in *v1beta1.Input, extraResources map[string][]resour } switch config.GetType() { case v1beta1.EnvironmentSourceTypeReference: + envConfigName := config.Ref.Name if len(resources) == 0 { if in.Spec.Policy.IsResolutionPolicyOptional() { continue } - return nil, errors.Errorf("Required environment config %q not found", extraResName) + return nil, errors.Errorf("Required environment config %q not found", envConfigName) } if len(resources) > 1 { - return nil, errors.Errorf("expected exactly one extra resource %q, got %d", extraResName, len(resources)) + return nil, errors.Errorf("expected exactly one extra resource %q, got %d", envConfigName, len(resources)) } envConfigs = append(envConfigs, *resources[0].Resource)