Skip to content

Commit

Permalink
Merge pull request #59 from stefnans/enhancement/display-missing-envc…
Browse files Browse the repository at this point in the history
…onfig-name
  • Loading branch information
phisco authored Dec 6, 2024
2 parents b1882f3 + 89347db commit 90c5b4e
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 90c5b4e

Please sign in to comment.