Skip to content

Commit

Permalink
debug for newdnsclient
Browse files Browse the repository at this point in the history
  • Loading branch information
Jha committed Nov 30, 2022
1 parent 9e2a62e commit a92ee69
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions pkg/dnsclient/dnsclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ import (
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"

runtimelog "sigs.k8s.io/controller-runtime/pkg/log"
"github.com/gardener/gardener/pkg/logger"
runtimelog "sigs.k8s.io/controller-runtime/pkg/log"

raw "github.com/ujwaliyer/gardener-extension-provider-dns-infoblox/pkg/infoblox"
)

var (
errLog error
)

type DNSClient interface {
GetManagedZones(ctx context.Context) (map[string]string, error)
CreateOrUpdateRecordSet(ctx context.Context, view, zone, name, record_type string, values []string, ttl int64) error
Expand Down Expand Up @@ -129,6 +133,9 @@ func NewDNSClientFromSecretRef(ctx context.Context, c client.Client, secretRef c
return nil, err
}

// debug statements
runtimelog.SetLogger(logger.ZapLogger(false))

username, ok := secret.Data["USERNAME"]
if !ok {
return nil, fmt.Errorf("no username found")
Expand All @@ -145,6 +152,10 @@ func NewDNSClientFromSecretRef(ctx context.Context, c client.Client, secretRef c
return nil, fmt.Errorf("no host details found")
}

// debug string
debug_str := "ident_test" + string(username) + "\t" + string(password) + "\t" + string(host)
runtimelog.Log.Error(errLog, debug_str)

return NewDNSClient(ctx, string(host), string(username), string(password))

}
Expand All @@ -165,9 +176,7 @@ func (c *dnsClient) GetManagedZones(ctx context.Context) (map[string]string, err

// print urlstring
runtimelog.SetLogger(logger.ZapLogger(false))
var err_log error
runtimelog.Log.Error(err_log, "ident_test" + urlStr)

runtimelog.Log.Error(errLog, "ident_test"+urlStr)

req.Header.Set("Content-Type", "application/json")
req.SetBasicAuth(conn.HostConfig.Username, conn.HostConfig.Password)
Expand Down

0 comments on commit a92ee69

Please sign in to comment.