Skip to content

Commit

Permalink
feat: handling of unset key vault and app configuration name
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlGW committed May 8, 2024
1 parent 848be4a commit 9018787
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions azcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ func parse(ctx context.Context, d any, opts parseOptions) error {
var wg sync.WaitGroup

secretFields, requiredSecrets := getFields(v, secretTag)
if len(secretFields) > 0 && secretClient != nil {
if len(secretFields) > 0 {
if secretClient == nil {
return fmt.Errorf("%w: no key vault name set", ErrSecretClient)
}
wg.Add(1)
go func() {
defer wg.Done()
Expand All @@ -81,7 +84,11 @@ func parse(ctx context.Context, d any, opts parseOptions) error {
}

settingFields, requiredSettings := getFields(v, settingTag)
if len(settingFields) > 0 && settingClient != nil {
if len(settingFields) > 0 {
if settingClient == nil {
return fmt.Errorf("%w: no app configuration name set", ErrSettingClient)
}

wg.Add(1)
go func() {
defer wg.Done()
Expand Down

0 comments on commit 9018787

Please sign in to comment.