Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dnsconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func Test_updateDockerConfig(t *testing.T) {
args: args{configPath: tmpFileName},
want: "{\"cgroup-parent\":\"/actions_job\",\"dns\":[\"172.17.0.1\"],\"live-restore\":true}",
wantErr: false},
{name: "non existent file",
{name: "nonexistent file",
args: args{configPath: mockDockerConfigPath},
want: "{\"dns\":[\"172.17.0.1\"],\"live-restore\":true}",
wantErr: false},
Expand Down
8 changes: 4 additions & 4 deletions dnsproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ func (proxy *DNSProxy) ResolveDomain(domain string) (*Answer, error) {
return nil, fmt.Errorf("error in response from dns.google %v", err)
}

var dnsReponse DNSResponse
var dnsResponse DNSResponse

err = json.Unmarshal([]byte(body), &dnsReponse)
err = json.Unmarshal([]byte(body), &dnsResponse)

if err != nil {
return nil, fmt.Errorf("error in response from dns.google %v", err)
}

for _, answer := range dnsReponse.Answer {
for _, answer := range dnsResponse.Answer {
if answer.Type == 1 {
if answer.TTL < 30 {
answer.TTL = 30 // less than 30 will cause too frequent DNS requests in audit scenario
Expand All @@ -164,7 +164,7 @@ func (proxy *DNSProxy) ResolveDomain(domain string) (*Answer, error) {
}
}

return nil, fmt.Errorf("unable to resolve domain %s, status %d", domain, dnsReponse.Status)
return nil, fmt.Errorf("unable to resolve domain %s, status %d", domain, dnsResponse.Status)
}

func getDomainFromCloudAppFormat(domain string) string {
Expand Down
2 changes: 1 addition & 1 deletion lockfile/lockfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var errUnlocked = errors.New("file is unlocked")

// Lockfile is a process-based file lock.
type Lockfile struct {
// path is the file whose existense is the lock.
// path is the file whose existence is the lock.
path string

// pid is our PID.
Expand Down