Skip to content

Commit

Permalink
fix(provider): patch type assertion in LetsEncrypt.Tune method
Browse files Browse the repository at this point in the history
  • Loading branch information
tgragnato committed Oct 8, 2024
1 parent d8f697c commit f7988aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions provider/letsencrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (p *LetsEncrypt) Tune(options map[string]interface{}) (err error) {
for _, configTarget := range configTargets.([]interface{}) {
var (
target = LetsEncryptTarget{environment: make(map[string]string)}
configTargetMap = configTarget.(map[interface{}]interface{})
configTargetMap = configTarget.(map[string]interface{})
)
domain, ok := configTargetMap["domain"]
if !ok {
Expand All @@ -89,19 +89,19 @@ func (p *LetsEncrypt) Tune(options map[string]interface{}) (err error) {
if !ok {
return fmt.Errorf("provider %s: target %s challenge not defined", p.ID(), target.domain)
}
challengeMap := challenge.(map[interface{}]interface{})
challengeMap := challenge.(map[string]interface{})

challengeProvider, ok := challengeMap["id"]
if !ok {
return fmt.Errorf("provider %s: target %s challenge type not defined", p.ID(), target.domain)
}
target.provider = challengeProvider.(string)

for key, value := range challenge.(map[interface{}]interface{}) {
if strings.EqualFold(key.(string), "id") {
for key, value := range challenge.(map[string]interface{}) {
if strings.EqualFold(key, "id") {
continue
}
target.environment[strings.ToUpper(key.(string))] = value.(string)
target.environment[strings.ToUpper(key)] = value.(string)
}

targets = append(targets, &target)
Expand Down

0 comments on commit f7988aa

Please sign in to comment.