Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output envconfig name if missing instead of generic extra resource name #59

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down