Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: operator-framework/operator-registry
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 57183c2882295ecf02b70907052d828be66dcccf
Choose a base ref
..
head repository: operator-framework/operator-registry
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 597b6ba90b2b13e3e0d1b90167fb1b6452505817
Choose a head ref
Showing with 22 additions and 22 deletions.
  1. +3 −3 pkg/lib/dns/nsswitch.go
  2. +19 −19 pkg/lib/dns/nsswitch_test.go
6 changes: 3 additions & 3 deletions pkg/lib/dns/nsswitch.go
Original file line number Diff line number Diff line change
@@ -7,9 +7,9 @@ import (
)

var (
GOOS = runtime.GOOS
GOOS = runtime.GOOS
NsswitchContents = []byte("hosts: files dns")
NsswitchFilename = "/etc/nsswitch.conf"
NsswitchFilename = "/etc/nsswitch.conf"
)

func EnsureNsswitch() error {
@@ -25,4 +25,4 @@ func EnsureNsswitch() error {
}

return ioutil.WriteFile(NsswitchFilename, NsswitchContents, 0644)
}
}
38 changes: 19 additions & 19 deletions pkg/lib/dns/nsswitch_test.go
Original file line number Diff line number Diff line change
@@ -9,37 +9,37 @@ import (

func TestEnsureNsswitch(t *testing.T) {
tests := []struct {
name string
goos string
name string
goos string
existingFile bool
wantFile bool
wantErr bool
wantFile bool
wantErr bool
}{
{
name: "no file",
goos: "linux",
name: "no file",
goos: "linux",
existingFile: false,
wantFile: true,
wantErr: false,
wantFile: true,
wantErr: false,
},
{
name: "existing file",
goos: "linux",
name: "existing file",
goos: "linux",
existingFile: true,
wantFile: false,
wantErr: false,
wantFile: false,
wantErr: false,
},
{
name: "windows",
goos: "windows",
name: "windows",
goos: "windows",
wantFile: false,
wantErr: false,
wantErr: false,
},
{
name: "mac",
goos: "darwin",
name: "mac",
goos: "darwin",
wantFile: false,
wantErr: false,
wantErr: false,
},
}
for _, tt := range tests {
@@ -70,4 +70,4 @@ func TestEnsureNsswitch(t *testing.T) {
}
})
}
}
}