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)