trim?
This commit is contained in:
parent
24d52851ca
commit
88996f6797
7
main.go
7
main.go
@ -121,6 +121,8 @@ func (c *customDNSProviderSolver) Present(ch *v1alpha1.ChallengeRequest) error {
|
|||||||
_zone = strings.TrimRight(_zone, ".")
|
_zone = strings.TrimRight(_zone, ".")
|
||||||
_key := "\"" + ch.Key + "\""
|
_key := "\"" + ch.Key + "\""
|
||||||
|
|
||||||
|
fmt.Println("ADD", _zone, _key)
|
||||||
|
|
||||||
err = dnsObj.AddRecord("TXT", _zone, _key, false, "")
|
err = dnsObj.AddRecord("TXT", _zone, _key, false, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -138,8 +140,11 @@ func (c *customDNSProviderSolver) Present(ch *v1alpha1.ChallengeRequest) error {
|
|||||||
// concurrently.
|
// concurrently.
|
||||||
func (c *customDNSProviderSolver) CleanUp(ch *v1alpha1.ChallengeRequest) error {
|
func (c *customDNSProviderSolver) CleanUp(ch *v1alpha1.ChallengeRequest) error {
|
||||||
|
|
||||||
|
_addr := strings.TrimRight(ch.ResolvedFQDN, ".")
|
||||||
_key := "\"" + ch.Key + "\""
|
_key := "\"" + ch.Key + "\""
|
||||||
_id, err := c.freedns.FindRecord(strings.TrimSuffix(ch.ResolvedZone, "."), "TXT", _key)
|
_id, err := c.freedns.FindRecord(_addr, "TXT", _key)
|
||||||
|
|
||||||
|
fmt.Println("DEL", _addr)
|
||||||
|
|
||||||
if _id != "" {
|
if _id != "" {
|
||||||
err = c.freedns.DeleteRecord(_id)
|
err = c.freedns.DeleteRecord(_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user