Closed cyberbutler closed 3 years ago
Just to be more concise the RecordType does not pass the CheckRecordType
validation in the namecheap
module. I cannot figure out why, I've also replicated the validation code with no issues:
package main
import (
"fmt"
"strings"
)
var (
allowedRecordTypes = []string{
"A", "AAAA", "ALIAS", "CAA", "CNAME", "MX", "MXE", "TXT", "URL", "URL301", "FRAME",
}
)
func main() {
if !CheckRecordType("A") {
fmt.Printf("Invalid record type, allowed types=%s", strings.Join(allowedRecordTypes, ", "))
} else {
fmt.Println("We are all good here")
}
}
func CheckRecordType(recordType string) bool {
for _, legalRecordType := range allowedRecordTypes {
if recordType == legalRecordType {
return true
}
}
return false
}
Terraform Version
Namecheap provider version
Both built from source and Release v1.5.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/cyberbutler/39753094328b7a623a5ebc5004e507ac
Expected Behavior
What should have happened? Valid Record Type
A
should have been passed to the Namecheap Go API SuccessfullyActual Behavior
What actually happened?
Steps to Reproduce
terraform apply
Important Factoids
Attempted to run from MacOS and Debian systems, both results in the same error. I've also run with both the released provider and built the provider from the
master
branch here. Same results.I tracked down the provided error here. I also added some janky
fmt.Printf
"debug" code into the local build of the provider to see what was held inRecordType
before it was passed to thenamecheap.client
but it didn't seem to be wrong in anyway. Perhaps there is a user error here somewhere?