@@ -60,7 +60,7 @@ func ParseProfile(ctx context.Context, basePath string, data map[string]interfac
6060 activatedProfiles := []string {}
6161 if ! disableProfileActivation {
6262 var err error
63- activatedProfiles , err = getActivatedProfiles (data , resolver , log )
63+ activatedProfiles , err = getActivatedProfiles (ctx , data , resolver , log )
6464 if err != nil {
6565 return nil , err
6666 }
@@ -305,7 +305,7 @@ func getProfiles(ctx context.Context, basePath string, data map[string]interface
305305 return errors .Errorf ("Couldn't find profile '%s'" , profile )
306306}
307307
308- func getActivatedProfiles (data map [string ]interface {}, resolver variable.Resolver , log log.Logger ) ([]string , error ) {
308+ func getActivatedProfiles (ctx context. Context , data map [string ]interface {}, resolver variable.Resolver , log log.Logger ) ([]string , error ) {
309309 activatedProfiles := []string {}
310310
311311 // Check if there are profiles
@@ -331,7 +331,7 @@ func getActivatedProfiles(data map[string]interface{}, resolver variable.Resolve
331331 return activatedProfiles , errors .Wrap (err , "error activating profile with env" )
332332 }
333333
334- activatedByVars , err := matchVars (activation .Vars , resolver )
334+ activatedByVars , err := matchVars (ctx , activation .Vars , resolver )
335335 if err != nil {
336336 return activatedProfiles , errors .Wrap (err , "error activating profile with vars" )
337337 }
@@ -360,9 +360,9 @@ func matchEnvironment(env map[string]string) (bool, error) {
360360 return true , nil
361361}
362362
363- func matchVars (activationVars map [string ]string , resolver variable.Resolver ) (bool , error ) {
363+ func matchVars (ctx context. Context , activationVars map [string ]string , resolver variable.Resolver ) (bool , error ) {
364364 for k , v := range activationVars {
365- value , err := resolveVariableValue (k , resolver )
365+ value , err := resolveVariableValue (ctx , k , resolver )
366366 if err != nil {
367367 return false , err
368368 }
@@ -393,8 +393,8 @@ func sanitizeMatchExpression(expression string) string {
393393 return exp
394394}
395395
396- func resolveVariableValue (name string , resolver variable.Resolver ) (string , error ) {
397- val , err := resolver .FillVariables (context . TODO () , "${" + name + "}" )
396+ func resolveVariableValue (ctx context. Context , name string , resolver variable.Resolver ) (string , error ) {
397+ val , err := resolver .FillVariables (ctx , "${" + name + "}" )
398398 if err != nil {
399399 return "" , err
400400 }
0 commit comments