Skip to content

Commit

Permalink
resolve clean up issue
Browse files Browse the repository at this point in the history
  • Loading branch information
RunnerM committed Sep 29, 2022
1 parent 4626c5d commit a596601
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (c *SimplyClient) AddTxtRecord(FQDNName string, Value string, credentials C

// RemoveTxtRecord Remove TXT record from symply
func (c *SimplyClient) RemoveTxtRecord(RecordId int, DnsName string, credentials Credentials) bool {
req, err := http.NewRequest("DELETE", apiUrl+"/my/products/"+domainutil.Domain(DnsName)+"/dns/records/"+strconv.Itoa(RecordId), nil)
req, err := http.NewRequest("DELETE", apiUrl+"/my/products/"+DnsName+"/dns/records/"+strconv.Itoa(RecordId), nil)
req.SetBasicAuth(credentials.AccountName, credentials.ApiKey)
client := &http.Client{}
response, err := client.Do(req)
Expand Down
8 changes: 4 additions & 4 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func TestAll(t *testing.T) {
apikey: "",
}
testAdd(t, data)
id := testGet(t, data)
testRemove(t, data, id)
//testGet(t, data)
//testRemove(t, data, 0)

}

Expand All @@ -42,7 +42,7 @@ func testAdd(t *testing.T, data testData) {
fmt.Println(id)
}
func testRemove(t *testing.T, data testData, id int) {
res := fixture.RemoveTxtRecord(id, data.data, Credentials{
res := fixture.RemoveTxtRecord(id, data.domain, Credentials{
AccountName: data.accountname,
ApiKey: data.apikey,
})
Expand All @@ -52,7 +52,7 @@ func testRemove(t *testing.T, data testData, id int) {

}
func testGet(t *testing.T, data testData) int {
id := fixture.GetTxtRecord(data.data, data.domain, Credentials{
id, _ := fixture.GetTxtRecord(data.data, data.domain, Credentials{
AccountName: data.accountname,
ApiKey: data.apikey,
})
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (e *SimplyDnsSolver) CleanUp(ch *v1alpha1.ChallengeRequest) error {
fmt.Errorf("load credentials failed: %v", err)
return err
}
Id, err := e.client.GetTxtRecord(ch.Key, ch.DNSName, cred)
Id, err := e.client.GetTxtRecord(ch.Key, ch.ResolvedFQDN, cred)
if err != nil {
fmt.Errorf("error on fetching record: %v", err)
return err
Expand Down

0 comments on commit a596601

Please sign in to comment.