Skip to content

Commit

Permalink
feat!: load common configuration (#426)
Browse files Browse the repository at this point in the history
* feat!: load common configuration

BREAKING CHANGE: calls to bootstrap.RunAndReturnWaitGroup must include the service type

Signed-off-by: Elizabeth J Lee <[email protected]>
  • Loading branch information
ejlee3 authored Feb 9, 2023
1 parent 6fc5971 commit e74b4a8
Show file tree
Hide file tree
Showing 6 changed files with 748 additions and 120 deletions.
9 changes: 6 additions & 3 deletions bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright 2019 Dell Inc.
* Copyright 2020 Intel Inc.
* Copyright 2023 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -88,7 +88,8 @@ func RunAndReturnWaitGroup(
configUpdated config.UpdatedStream,
startupTimer startup.Timer,
dic *di.Container,
useSecretProvider bool,
useSecretProvider bool, // TODO: remove useSecretProvider and use serviceType in place with its constant
serviceType string,
handlers []interfaces.BootstrapHandler) (*sync.WaitGroup, Deferred, bool) {

var err error
Expand Down Expand Up @@ -122,7 +123,7 @@ func RunAndReturnWaitGroup(
// to the need for it to be used to get Access Token for the Configuration Provider and having to wait to
// initialize it until after the configuration is loaded from file.
configProcessor := config.NewProcessor(commonFlags, envVars, startupTimer, ctx, &wg, configUpdated, dic)
if err := configProcessor.Process(serviceKey, configStem, serviceConfig, secretProvider); err != nil {
if err := configProcessor.Process(serviceKey, serviceType, configStem, serviceConfig, secretProvider); err != nil {
fatalError(err, lc)
}

Expand Down Expand Up @@ -208,6 +209,7 @@ func Run(
startupTimer startup.Timer,
dic *di.Container,
useSecretProvider bool,
serviceType string,
handlers []interfaces.BootstrapHandler) {

wg, deferred, success := RunAndReturnWaitGroup(
Expand All @@ -221,6 +223,7 @@ func Run(
startupTimer,
dic,
useSecretProvider,
serviceType,
handlers,
)

Expand Down
Loading

0 comments on commit e74b4a8

Please sign in to comment.