Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
delete check env for function name
Browse files Browse the repository at this point in the history
Signed-off-by: Rodolfo Sanchez <[email protected]>
  • Loading branch information
dolfolife committed Jul 20, 2022
1 parent 894ea79 commit bec819f
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions buildpacks/java/java/func_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,15 @@ func ParseFuncYaml(filedir string, logger bard.Logger) FuncYaml {

options := optionsToMap(cfg.Options, logger)
envs := envsToMap(cfg.Envs, logger)
name := getName(cfg.Envs, cfg.Name)

return FuncYaml{
Name: name,
Name: cfg.Name,
Options: options,
Envs: envs,
Exists: true,
}
}

func getName(envs knfn.Envs, nameFromYaml string) string {
result := nameFromYaml

if envs == nil {
return result
}

for _, e := range envs {
key := *e.Name
if key == "FUNCTION_NAME" {
result = *e.Value
break
}
}

return result
}

func envsToMap(envs knfn.Envs, logger bard.Logger) map[string]string {
result := map[string]string{}
if envs == nil {
Expand Down

0 comments on commit bec819f

Please sign in to comment.