diff --git a/vendor/github.com/docker/docker/libnetwork/internal/resolvconf/resolvconf.go b/executor/oci/internal/resolvconf/resolvconf.go similarity index 67% rename from vendor/github.com/docker/docker/libnetwork/internal/resolvconf/resolvconf.go rename to executor/oci/internal/resolvconf/resolvconf.go index 4261844cc17c..c00a50c7d914 100644 --- a/vendor/github.com/docker/docker/libnetwork/internal/resolvconf/resolvconf.go +++ b/executor/oci/internal/resolvconf/resolvconf.go @@ -1,6 +1,3 @@ -// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.23 - // Package resolvconf is used to generate a container's /etc/resolv.conf file. // // Constructor Load and Parse read a resolv.conf file from the filesystem or @@ -21,19 +18,15 @@ import ( "bufio" "bytes" "context" - "fmt" "io" - "io/fs" "net/netip" "os" + "slices" "strconv" "strings" - "text/template" - "github.com/containerd/log" - "github.com/moby/sys/atomicwriter" - "github.com/opencontainers/go-digest" - "github.com/pkg/errors" + "github.com/moby/buildkit/errdefs" + "github.com/moby/buildkit/util/bklog" ) // Fallback nameservers, to use if none can be obtained from the host or command @@ -70,7 +63,7 @@ type ExtDNSEntry struct { func (ed ExtDNSEntry) String() string { if ed.HostLoopback { - return fmt.Sprintf("host(%s)", ed.Addr) + return "host(" + ed.Addr.String() + ")" } return ed.Addr.String() } @@ -119,7 +112,7 @@ func Parse(reader io.Reader, path string) (ResolvConf, error) { rc.processLine(scanner.Text()) } if err := scanner.Err(); err != nil { - return ResolvConf{}, errSystem{err} + return ResolvConf{}, errdefs.Internal(err) } if _, ok := rc.Option("ndots"); ok { rc.md.NDotsFrom = "host" @@ -141,7 +134,7 @@ func (rc *ResolvConf) SetHeader(c string) { // NameServers returns addresses used in nameserver directives. func (rc *ResolvConf) NameServers() []netip.Addr { - return append([]netip.Addr(nil), rc.nameServers...) + return slices.Clone(rc.nameServers) } // OverrideNameServers replaces the current set of nameservers. @@ -152,7 +145,7 @@ func (rc *ResolvConf) OverrideNameServers(nameServers []netip.Addr) { // Search returns the current DNS search domains. func (rc *ResolvConf) Search() []string { - return append([]string(nil), rc.search...) + return slices.Clone(rc.search) } // OverrideSearch replaces the current DNS search domains. @@ -169,7 +162,7 @@ func (rc *ResolvConf) OverrideSearch(search []string) { // Options returns the current options. func (rc *ResolvConf) Options() []string { - return append([]string(nil), rc.options...) + return slices.Clone(rc.options) } // Option finds the last option named search, and returns (value, true) if @@ -181,7 +174,7 @@ func (rc *ResolvConf) Options() []string { // Option("ndots") -> ("1", true) // Option("edns0") -> ("", true) func (rc *ResolvConf) Option(search string) (string, bool) { - for i := len(rc.options) - 1; i >= 0; i -= 1 { + for i := len(rc.options) - 1; i >= 0; i-- { k, v, _ := strings.Cut(rc.options[i], ":") if k == search { return v, true @@ -192,7 +185,7 @@ func (rc *ResolvConf) Option(search string) (string, bool) { // OverrideOptions replaces the current DNS options. func (rc *ResolvConf) OverrideOptions(options []string) { - rc.options = append([]string(nil), options...) + rc.options = slices.Clone(options) rc.md.NDotsFrom = "" if _, exists := rc.Option("ndots"); exists { rc.md.NDotsFrom = "override" @@ -227,7 +220,7 @@ func (rc *ResolvConf) TransformForLegacyNw(ipv6 bool) { } rc.nameServers = filtered if len(rc.nameServers) == 0 { - log.G(context.TODO()).Info("No non-localhost DNS nameservers are left in resolv.conf. Using default external servers") + bklog.G(context.TODO()).Info("No non-localhost DNS nameservers are left in resolv.conf. Using default external servers") rc.nameServers = defaultNSAddrs(ipv6) rc.md.Warnings = append(rc.md.Warnings, "Used default nameservers.") } @@ -283,145 +276,123 @@ func (rc *ResolvConf) TransformForIntNS( if len(rc.md.ExtNameServers) == 0 { rc.md.Warnings = append(rc.md.Warnings, "NO EXTERNAL NAMESERVERS DEFINED") } - return append([]ExtDNSEntry(nil), rc.md.ExtNameServers...), nil + return slices.Clone(rc.md.ExtNameServers), nil } // Generate returns content suitable for writing to a resolv.conf file. If comments // is true, the file will include header information if supplied, and a trailing // comment that describes how the file was constructed and lists external resolvers. func (rc *ResolvConf) Generate(comments bool) ([]byte, error) { - s := struct { - Md *metadata - NameServers []netip.Addr - Search []string - Options []string - Other []string - Overrides []string - Comments bool - }{ - Md: &rc.md, - NameServers: rc.nameServers, - Search: rc.search, - Options: rc.options, - Other: rc.other, - Comments: comments, - } - if rc.md.NSOverride { - s.Overrides = append(s.Overrides, "nameservers") - } - if rc.md.SearchOverride { - s.Overrides = append(s.Overrides, "search") - } - if rc.md.OptionsOverride { - s.Overrides = append(s.Overrides, "options") - } - - const templateText = `{{if .Comments}}{{with .Md.Header}}{{.}} - -{{end}}{{end}}{{range .NameServers -}} -nameserver {{.}} -{{end}}{{with .Search -}} -search {{join . " "}} -{{end}}{{with .Options -}} -options {{join . " "}} -{{end}}{{with .Other -}} -{{join . "\n"}} -{{end}}{{if .Comments}} -# Based on host file: '{{.Md.SourcePath}}'{{with .Md.Transform}} ({{.}}){{end}} -{{range .Md.Warnings -}} -# {{.}} -{{end -}} -{{with .Md.ExtNameServers -}} -# ExtServers: {{.}} -{{end -}} -{{with .Md.InvalidNSs -}} -# Invalid nameservers: {{.}} -{{end -}} -# Overrides: {{.Overrides}} -{{with .Md.NDotsFrom -}} -# Option ndots from: {{.}} -{{end -}} -{{end -}} -` - - funcs := template.FuncMap{"join": strings.Join} - var buf bytes.Buffer - templ, err := template.New("summary").Funcs(funcs).Parse(templateText) - if err != nil { - return nil, errSystem{err} + var b bytes.Buffer + b.Grow(512) // estimated size for a regular resolv.conf we produce. + + if comments && rc.md.Header != "" { + b.WriteString(rc.md.Header + "\n") + b.WriteByte('\n') + } + for _, ns := range rc.nameServers { + b.WriteString("nameserver ") + b.WriteString(ns.String()) + b.WriteByte('\n') + } + if len(rc.search) > 0 { + b.WriteString("search ") + for i, s := range rc.search { + if i > 0 { + b.WriteByte(' ') + } + b.WriteString(s) + } + b.WriteByte('\n') } - if err := templ.Execute(&buf, s); err != nil { - return nil, errSystem{err} + if len(rc.options) > 0 { + b.WriteString("options ") + for i, s := range rc.options { + if i > 0 { + b.WriteByte(' ') + } + b.WriteString(s) + } + b.WriteByte('\n') } - return buf.Bytes(), nil -} - -// WriteFile generates content and writes it to path. If hashPath is non-zero, it -// also writes a file containing a hash of the content, to enable UserModified() -// to determine whether the file has been modified. -func (rc *ResolvConf) WriteFile(path, hashPath string, perm os.FileMode) error { - content, err := rc.Generate(true) - if err != nil { - return err + for _, o := range rc.other { + b.WriteString(o) + b.WriteByte('\n') } - // Write the resolv.conf file - it's bind-mounted into the container, so can't - // move a temp file into place, just have to truncate and write it. - if err := os.WriteFile(path, content, perm); err != nil { - return errSystem{err} - } + if comments { + b.WriteByte('\n') + b.WriteString("# Based on host file: '" + rc.md.SourcePath + "'") + if rc.md.Transform != "" { + b.WriteString(" (" + rc.md.Transform + ")") + } + b.WriteByte('\n') + for _, w := range rc.md.Warnings { + b.WriteString("# ") + b.WriteString(w) + b.WriteByte('\n') + } + if len(rc.md.ExtNameServers) > 0 { + b.WriteString("# ExtServers: [") + for i, ext := range rc.md.ExtNameServers { + if i > 0 { + b.WriteByte(' ') + } + b.WriteString(ext.String()) + } + b.WriteByte(']') + b.WriteByte('\n') + } + if len(rc.md.InvalidNSs) > 0 { + b.WriteString("# Invalid nameservers: [") + for i, ext := range rc.md.InvalidNSs { + if i > 0 { + b.WriteByte(' ') + } + b.WriteString(ext) + } + b.WriteByte(']') + b.WriteByte('\n') + } - // Write the hash file. - if hashPath != "" { - hashFile, err := atomicwriter.New(hashPath, perm) - if err != nil { - return errSystem{err} + b.WriteString("# Overrides: [") + var overrides int + if rc.md.NSOverride { + b.WriteString("nameservers") + overrides++ + } + if rc.md.SearchOverride { + if overrides > 0 { + b.WriteByte(' ') + } + b.WriteString("search") + overrides++ } - defer hashFile.Close() + if rc.md.OptionsOverride { + if overrides > 0 { + b.WriteByte(' ') + } + b.WriteString("options") + } + b.WriteByte(']') + b.WriteByte('\n') - if _, err = hashFile.Write([]byte(digest.FromBytes(content))); err != nil { - return err + if rc.md.NDotsFrom != "" { + b.WriteString("# Option ndots from: " + rc.md.NDotsFrom + "\n") } } - return nil + return b.Bytes(), nil } -// UserModified can be used to determine whether the resolv.conf file has been -// modified since it was generated. It returns false with no error if the file -// matches the hash, true with no error if the file no longer matches the hash, -// and false with an error if the result cannot be determined. -func UserModified(rcPath, rcHashPath string) (bool, error) { - currRCHash, err := os.ReadFile(rcHashPath) - if err != nil { - // If the hash file doesn't exist, can only assume it hasn't been written - // yet (so, the user hasn't modified the file it hashes). - if errors.Is(err, fs.ErrNotExist) { - return false, nil - } - return false, errors.Wrapf(err, "failed to read hash file %s", rcHashPath) - } - expected, err := digest.Parse(string(currRCHash)) - if err != nil { - return false, errors.Wrapf(err, "failed to parse hash file %s", rcHashPath) - } - v := expected.Verifier() - currRC, err := os.Open(rcPath) - if err != nil { - return false, errors.Wrapf(err, "failed to open %s to check for modifications", rcPath) - } - defer currRC.Close() - if _, err := io.Copy(v, currRC); err != nil { - return false, errors.Wrapf(err, "failed to hash %s to check for modifications", rcPath) +func (rc *ResolvConf) processLine(line string) { + // Strip blank lines and comments. + if line == "" || line[0] == '#' || line[0] == ';' { + return } - return !v.Verified(), nil -} -func (rc *ResolvConf) processLine(line string) { fields := strings.Fields(line) - - // Strip blank lines and comments. - if len(fields) == 0 || fields[0][0] == '#' || fields[0][0] == ';' { + if len(fields) == 0 { return } @@ -470,8 +441,11 @@ func defaultNSAddrs(ipv6 bool) []netip.Addr { func removeInvalidNDots(options []string) []string { n := 0 for _, opt := range options { - k, v, _ := strings.Cut(opt, ":") + k, v, hasSep := strings.Cut(opt, ":") if k == "ndots" { + if !hasSep || v == "" { + continue + } ndots, err := strconv.Atoi(v) if err != nil || ndots < 0 { continue @@ -483,16 +457,3 @@ func removeInvalidNDots(options []string) []string { clear(options[n:]) // Zero out the obsolete elements, for GC. return options[:n] } - -// errSystem implements [github.com/docker/docker/errdefs.ErrSystem]. -// -// We don't use the errdefs helpers here, because the resolvconf package -// is imported in BuildKit, and this is the only location that used the -// errdefs package outside of the client. -type errSystem struct{ error } - -func (errSystem) System() {} - -func (e errSystem) Unwrap() error { - return e.error -} diff --git a/vendor/github.com/docker/docker/libnetwork/internal/resolvconf/resolvconf_path.go b/executor/oci/internal/resolvconf/resolvconf_path.go similarity index 91% rename from vendor/github.com/docker/docker/libnetwork/internal/resolvconf/resolvconf_path.go rename to executor/oci/internal/resolvconf/resolvconf_path.go index 65d0fe14098d..69e40c12b0f1 100644 --- a/vendor/github.com/docker/docker/libnetwork/internal/resolvconf/resolvconf_path.go +++ b/executor/oci/internal/resolvconf/resolvconf_path.go @@ -5,7 +5,7 @@ import ( "net/netip" "sync" - "github.com/containerd/log" + "github.com/moby/buildkit/util/bklog" ) const ( @@ -49,7 +49,7 @@ func Path() string { ns := rc.nameServers if len(ns) == 1 && ns[0] == netip.MustParseAddr("127.0.0.53") { pathAfterSystemdDetection = alternatePath - log.G(context.TODO()).Infof("detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: %s", alternatePath) + bklog.G(context.TODO()).Infof("detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: %s", alternatePath) } }) return pathAfterSystemdDetection diff --git a/executor/oci/internal/resolvconf/resolvconf_test.go b/executor/oci/internal/resolvconf/resolvconf_test.go new file mode 100644 index 000000000000..446b4210d222 --- /dev/null +++ b/executor/oci/internal/resolvconf/resolvconf_test.go @@ -0,0 +1,512 @@ +package resolvconf + +import ( + "bytes" + "net/netip" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestRCOption(t *testing.T) { + testcases := []struct { + name string + options string + search string + expFound bool + expValue string + }{ + { + name: "Empty options", + options: "", + search: "ndots", + }, + { + name: "Not found", + options: "ndots:0 edns0", + search: "trust-ad", + }, + { + name: "Found with value", + options: "ndots:0 edns0", + search: "ndots", + expFound: true, + expValue: "0", + }, + { + name: "Found without value", + options: "ndots:0 edns0", + search: "edns0", + expFound: true, + expValue: "", + }, + { + name: "Found last value", + options: "ndots:0 edns0 ndots:1", + search: "ndots", + expFound: true, + expValue: "1", + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + rc, err := Parse(bytes.NewBufferString("options "+tc.options), "") + require.NoError(t, err) + value, found := rc.Option(tc.search) + assert.Equal(t, tc.expFound, found) + assert.Equal(t, tc.expValue, value) + }) + } +} + +var ( + a2s = sliceutilMapper(netip.Addr.String) + s2a = sliceutilMapper(netip.MustParseAddr) +) + +// Test that a resolv.conf file can be modified using OverrideXXX() methods +// to modify nameservers/search/options directives, and tha options can be +// added via AddOption(). +func TestRCModify(t *testing.T) { + testcases := []struct { + name string + inputNS []string + inputSearch []string + inputOptions []string + noOverrides bool // Whether to apply overrides (empty lists are valid overrides). + overrideNS []string + overrideSearch []string + overrideOptions []string + addOption string + }{ + { + name: "No content no overrides", + inputNS: []string{}, + }, + { + name: "No overrides", + noOverrides: true, + inputNS: []string{"1.2.3.4"}, + inputSearch: []string{"invalid"}, + inputOptions: []string{"ndots:0"}, + }, + { + name: "Empty overrides", + inputNS: []string{"1.2.3.4"}, + inputSearch: []string{"invalid"}, + inputOptions: []string{"ndots:0"}, + }, + { + name: "Overrides", + inputNS: []string{"1.2.3.4"}, + inputSearch: []string{"invalid"}, + inputOptions: []string{"ndots:0"}, + overrideNS: []string{"2.3.4.5", "fdba:acdd:587c::53"}, + overrideSearch: []string{"com", "invalid", "example"}, + overrideOptions: []string{"ndots:1", "edns0", "trust-ad"}, + }, + { + name: "Add option no overrides", + noOverrides: true, + inputNS: []string{"1.2.3.4"}, + inputSearch: []string{"invalid"}, + inputOptions: []string{"ndots:0"}, + addOption: "attempts:3", + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + tc := tc + var input string + if len(tc.inputNS) != 0 { + for _, ns := range tc.inputNS { + input += "nameserver " + ns + "\n" + } + } + if len(tc.inputSearch) != 0 { + input += "search " + strings.Join(tc.inputSearch, " ") + "\n" + } + if len(tc.inputOptions) != 0 { + input += "options " + strings.Join(tc.inputOptions, " ") + "\n" + } + rc, err := Parse(bytes.NewBufferString(input), "") + require.NoError(t, err) + assert.Equal(t, tc.inputNS, a2s(rc.NameServers())) + assert.Equal(t, tc.inputSearch, rc.Search()) + assert.Equal(t, tc.inputOptions, rc.Options()) + + if !tc.noOverrides { + overrideNS := s2a(tc.overrideNS) + rc.OverrideNameServers(overrideNS) + rc.OverrideSearch(tc.overrideSearch) + rc.OverrideOptions(tc.overrideOptions) + + assert.Equal(t, overrideNS, rc.NameServers()) + assert.Equal(t, tc.overrideSearch, rc.Search()) + assert.Equal(t, tc.overrideOptions, rc.Options()) + } + + if tc.addOption != "" { + options := rc.Options() + rc.AddOption(tc.addOption) + assert.Equal(t, append(options, tc.addOption), rc.Options()) + } + + content, err := rc.Generate(true) + require.NoError(t, err) + assertGolden(t, t.Name()+".golden", string(content)) + }) + } +} + +func TestRCTransformForLegacyNw(t *testing.T) { + testcases := []struct { + name string + input string + ipv6 bool + overrideNS []string + }{ + { + name: "Routable IPv4 only", + input: "nameserver 10.0.0.1", + }, + { + name: "Routable IPv4 and IPv6, ipv6 enabled", + input: "nameserver 10.0.0.1\nnameserver fdb6:b8fe:b528::1", + ipv6: true, + }, + { + name: "Routable IPv4 and IPv6, ipv6 disabled", + input: "nameserver 10.0.0.1\nnameserver fdb6:b8fe:b528::1", + ipv6: false, + }, + { + name: "IPv4 localhost, ipv6 disabled", + input: "nameserver 127.0.0.53", + ipv6: false, + }, + { + name: "IPv4 localhost, ipv6 enabled", + input: "nameserver 127.0.0.53", + ipv6: true, + }, + { + name: "IPv4 and IPv6 localhost, ipv6 disabled", + input: "nameserver 127.0.0.53\nnameserver ::1", + ipv6: false, + }, + { + name: "IPv4 and IPv6 localhost, ipv6 enabled", + input: "nameserver 127.0.0.53\nnameserver ::1", + ipv6: true, + }, + { + name: "IPv4 localhost, IPv6 routeable, ipv6 enabled", + input: "nameserver 127.0.0.53\nnameserver fd3e:2d1a:1f5a::1", + ipv6: true, + }, + { + name: "IPv4 localhost, IPv6 routeable, ipv6 disabled", + input: "nameserver 127.0.0.53\nnameserver fd3e:2d1a:1f5a::1", + ipv6: false, + }, + { + name: "Override nameservers", + input: "nameserver 127.0.0.53", + overrideNS: []string{"127.0.0.1", "::1"}, + ipv6: false, + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + tc := tc + rc, err := Parse(bytes.NewBufferString(tc.input), "/etc/resolv.conf") + require.NoError(t, err) + if tc.overrideNS != nil { + rc.OverrideNameServers(s2a(tc.overrideNS)) + } + + rc.TransformForLegacyNw(tc.ipv6) + + content, err := rc.Generate(true) + require.NoError(t, err) + assertGolden(t, t.Name()+".golden", string(content)) + }) + } +} + +func TestRCTransformForIntNS(t *testing.T) { + mke := func(addr string, hostLoopback bool) ExtDNSEntry { + return ExtDNSEntry{ + Addr: netip.MustParseAddr(addr), + HostLoopback: hostLoopback, + } + } + + testcases := []struct { + name string + input string + intNameServer string + overrideNS []string + overrideOptions []string + reqdOptions []string + expExtServers []ExtDNSEntry + expErr string + }{ + { + name: "IPv4 only", + input: "nameserver 10.0.0.1", + expExtServers: []ExtDNSEntry{mke("10.0.0.1", true)}, + }, + { + name: "IPv4 and IPv6, ipv6 enabled", + input: "nameserver 10.0.0.1\nnameserver fdb6:b8fe:b528::1", + expExtServers: []ExtDNSEntry{ + mke("10.0.0.1", true), + mke("fdb6:b8fe:b528::1", true), + }, + }, + { + name: "IPv4 localhost", + input: "nameserver 127.0.0.53", + expExtServers: []ExtDNSEntry{mke("127.0.0.53", true)}, + }, + { + // Overriding the nameserver with a localhost address means use the container's + // loopback interface, not the host's. + name: "IPv4 localhost override", + input: "nameserver 10.0.0.1", + overrideNS: []string{"127.0.0.53"}, + expExtServers: []ExtDNSEntry{mke("127.0.0.53", false)}, + }, + { + name: "IPv6 only", + input: "nameserver fd14:6e0e:f855::1", + expExtServers: []ExtDNSEntry{mke("fd14:6e0e:f855::1", true)}, + }, + { + name: "IPv4 and IPv6 localhost", + input: "nameserver 127.0.0.53\nnameserver ::1", + expExtServers: []ExtDNSEntry{ + mke("127.0.0.53", true), + mke("::1", true), + }, + }, + { + name: "ndots present and required", + input: "nameserver 127.0.0.53\noptions ndots:1", + reqdOptions: []string{"ndots:0"}, + expExtServers: []ExtDNSEntry{mke("127.0.0.53", true)}, + }, + { + name: "ndots missing but required", + input: "nameserver 127.0.0.53", + reqdOptions: []string{"ndots:0"}, + expExtServers: []ExtDNSEntry{mke("127.0.0.53", true)}, + }, + { + name: "ndots host, override and required", + input: "nameserver 127.0.0.53", + reqdOptions: []string{"ndots:0"}, + overrideOptions: []string{"ndots:2"}, + expExtServers: []ExtDNSEntry{mke("127.0.0.53", true)}, + }, + { + name: "Extra required options", + input: "nameserver 127.0.0.53\noptions trust-ad", + reqdOptions: []string{"ndots:0", "attempts:3", "edns0", "trust-ad"}, + expExtServers: []ExtDNSEntry{mke("127.0.0.53", true)}, + }, + { + name: "No config", + input: "", + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + tc := tc + rc, err := Parse(bytes.NewBufferString(tc.input), "/etc/resolv.conf") + require.NoError(t, err) + + if tc.intNameServer == "" { + tc.intNameServer = "127.0.0.11" + } + if len(tc.overrideNS) > 0 { + rc.OverrideNameServers(s2a(tc.overrideNS)) + } + if len(tc.overrideOptions) > 0 { + rc.OverrideOptions(tc.overrideOptions) + } + intNS := netip.MustParseAddr(tc.intNameServer) + extNameServers, err := rc.TransformForIntNS(intNS, tc.reqdOptions) + if tc.expErr != "" { + assert.ErrorContains(t, err, tc.expErr) + return + } + require.NoError(t, err) + + content, err := rc.Generate(true) + require.NoError(t, err) + assertGolden(t, t.Name()+".golden", string(content)) + assert.Equal(t, tc.expExtServers, extNameServers) + }) + } +} + +// Check that invalid ndots options in the host's file are ignored, unless +// starting the internal resolver (which requires an ndots option), in which +// case invalid ndots should be replaced. +func TestRCTransformForIntNSInvalidNdots(t *testing.T) { + testcases := []struct { + name string + options string + reqdOptions []string + expVal string + expOptions []string + expNDotsFrom string + }{ + { + name: "Negative value", + options: "options ndots:-1", + expOptions: []string{"ndots:-1"}, + expVal: "-1", + expNDotsFrom: "host", + }, + { + name: "Invalid values with reqd ndots", + options: "options ndots:-1 foo:bar ndots ndots:", + reqdOptions: []string{"ndots:2"}, + expVal: "2", + expNDotsFrom: "internal", + expOptions: []string{"foo:bar", "ndots:2"}, + }, + { + name: "Valid value with reqd ndots", + options: "options ndots:1 foo:bar ndots ndots:", + reqdOptions: []string{"ndots:2"}, + expVal: "1", + expNDotsFrom: "host", + expOptions: []string{"ndots:1", "foo:bar"}, + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + content := "nameserver 8.8.8.8\n" + tc.options + rc, err := Parse(bytes.NewBufferString(content), "/etc/resolv.conf") + require.NoError(t, err) + _, err = rc.TransformForIntNS(netip.MustParseAddr("127.0.0.11"), tc.reqdOptions) + require.NoError(t, err) + + val, found := rc.Option("ndots") + assert.True(t, found) + assert.Equal(t, tc.expVal, val) + assert.Equal(t, tc.expNDotsFrom, rc.md.NDotsFrom) + assert.Equal(t, tc.expOptions, rc.options) + }) + } +} + +func TestRCRead(t *testing.T) { + d := t.TempDir() + path := filepath.Join(d, "resolv.conf") + + // Try to read a nonexistent file, equivalent to an empty file. + _, err := Load(path) + require.ErrorIs(t, err, os.ErrNotExist) + + err = os.WriteFile(path, []byte("options edns0"), 0o644) + require.NoError(t, err) + + // Read that file in the constructor. + rc, err := Load(path) + require.NoError(t, err) + assert.Equal(t, []string{"edns0"}, rc.Options()) + + // Pass in an os.File, check the path is extracted. + file, err := os.Open(path) + require.NoError(t, err) + rc, err = Parse(file, "") + _ = file.Close() + require.NoError(t, err) + assert.Equal(t, path, rc.md.SourcePath) +} + +func TestRCInvalidNS(t *testing.T) { + // A resolv.conf with an invalid nameserver address. + rc, err := Parse(bytes.NewBufferString("nameserver 1.2.3.4.5"), "") + require.NoError(t, err) + + content, err := rc.Generate(true) + require.NoError(t, err) + assertGolden(t, t.Name()+".golden", string(content)) +} + +func TestRCSetHeader(t *testing.T) { + rc, err := Parse(bytes.NewBufferString("nameserver 127.0.0.53"), "/etc/resolv.conf") + require.NoError(t, err) + + rc.SetHeader("# This is a comment.") + + content, err := rc.Generate(true) + require.NoError(t, err) + assertGolden(t, t.Name()+".golden", string(content)) +} + +func TestRCUnknownDirectives(t *testing.T) { + const input = ` +something unexpected +nameserver 127.0.0.53 +options ndots:1 +unrecognised thing +` + rc, err := Parse(bytes.NewBufferString(input), "/etc/resolv.conf") + require.NoError(t, err) + + content, err := rc.Generate(true) + require.NoError(t, err) + assertGolden(t, t.Name()+".golden", string(content)) +} + +func BenchmarkGenerate(b *testing.B) { + rc := &ResolvConf{ + nameServers: []netip.Addr{ + netip.MustParseAddr("8.8.8.8"), + netip.MustParseAddr("1.1.1.1"), + }, + search: []string{"example.com", "svc.local"}, + options: []string{"ndots:1", "ndots:2", "ndots:3"}, + other: []string{"something", "something else", "something else"}, + md: metadata{ + Header: `# Generated by Docker Engine. +# This file can be edited; Docker Engine will not make further changes once it +# has been modified.`, + NSOverride: true, + SearchOverride: true, + OptionsOverride: true, + NDotsFrom: "host", + ExtNameServers: []ExtDNSEntry{ + {Addr: netip.MustParseAddr("127.0.0.53"), HostLoopback: true}, + {Addr: netip.MustParseAddr("2.2.2.2"), HostLoopback: false}, + }, + InvalidNSs: []string{"256.256.256.256"}, + Warnings: []string{"bad nameserver ignored"}, + }, + } + + b.ReportAllocs() + for i := 0; i < b.N; i++ { + _, err := rc.Generate(true) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/executor/oci/internal/resolvconf/testdata/.gitattributes b/executor/oci/internal/resolvconf/testdata/.gitattributes new file mode 100644 index 000000000000..6313b56c5784 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/executor/oci/internal/resolvconf/testdata/TestRCInvalidNS.golden b/executor/oci/internal/resolvconf/testdata/TestRCInvalidNS.golden new file mode 100644 index 000000000000..34c9172b32ee --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCInvalidNS.golden @@ -0,0 +1,4 @@ + +# Based on host file: '' +# Invalid nameservers: [1.2.3.4.5] +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCModify/Add_option_no_overrides.golden b/executor/oci/internal/resolvconf/testdata/TestRCModify/Add_option_no_overrides.golden new file mode 100644 index 000000000000..e4e5b287d841 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCModify/Add_option_no_overrides.golden @@ -0,0 +1,7 @@ +nameserver 1.2.3.4 +search invalid +options ndots:0 attempts:3 + +# Based on host file: '' +# Overrides: [] +# Option ndots from: host diff --git a/executor/oci/internal/resolvconf/testdata/TestRCModify/Empty_overrides.golden b/executor/oci/internal/resolvconf/testdata/TestRCModify/Empty_overrides.golden new file mode 100644 index 000000000000..75a0159f2c66 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCModify/Empty_overrides.golden @@ -0,0 +1,3 @@ + +# Based on host file: '' +# Overrides: [nameservers search options] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCModify/No_content_no_overrides.golden b/executor/oci/internal/resolvconf/testdata/TestRCModify/No_content_no_overrides.golden new file mode 100644 index 000000000000..75a0159f2c66 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCModify/No_content_no_overrides.golden @@ -0,0 +1,3 @@ + +# Based on host file: '' +# Overrides: [nameservers search options] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCModify/No_overrides.golden b/executor/oci/internal/resolvconf/testdata/TestRCModify/No_overrides.golden new file mode 100644 index 000000000000..6ce29386fcc0 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCModify/No_overrides.golden @@ -0,0 +1,7 @@ +nameserver 1.2.3.4 +search invalid +options ndots:0 + +# Based on host file: '' +# Overrides: [] +# Option ndots from: host diff --git a/executor/oci/internal/resolvconf/testdata/TestRCModify/Overrides.golden b/executor/oci/internal/resolvconf/testdata/TestRCModify/Overrides.golden new file mode 100644 index 000000000000..62d6ef61dbd6 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCModify/Overrides.golden @@ -0,0 +1,8 @@ +nameserver 2.3.4.5 +nameserver fdba:acdd:587c::53 +search com invalid example +options ndots:1 edns0 trust-ad + +# Based on host file: '' +# Overrides: [nameservers search options] +# Option ndots from: override diff --git a/executor/oci/internal/resolvconf/testdata/TestRCSetHeader.golden b/executor/oci/internal/resolvconf/testdata/TestRCSetHeader.golden new file mode 100644 index 000000000000..beed1a765806 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCSetHeader.golden @@ -0,0 +1,6 @@ +# This is a comment. + +nameserver 127.0.0.53 + +# Based on host file: '/etc/resolv.conf' +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/Extra_required_options.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/Extra_required_options.golden new file mode 100644 index 000000000000..68fd46720747 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/Extra_required_options.golden @@ -0,0 +1,7 @@ +nameserver 127.0.0.11 +options trust-ad ndots:0 attempts:3 edns0 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [host(127.0.0.53)] +# Overrides: [] +# Option ndots from: internal diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6,_ipv6_enabled.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6,_ipv6_enabled.golden new file mode 100644 index 000000000000..04308659f30f --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6,_ipv6_enabled.golden @@ -0,0 +1,5 @@ +nameserver 127.0.0.11 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [host(10.0.0.1) host(fdb6:b8fe:b528::1)] +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6_localhost.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6_localhost.golden new file mode 100644 index 000000000000..387cc713b7b3 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_and_IPv6_localhost.golden @@ -0,0 +1,5 @@ +nameserver 127.0.0.11 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [host(127.0.0.53) host(::1)] +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost.golden new file mode 100644 index 000000000000..926d44d49a12 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost.golden @@ -0,0 +1,5 @@ +nameserver 127.0.0.11 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [host(127.0.0.53)] +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost_override.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost_override.golden new file mode 100644 index 000000000000..da55aad0caf3 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_localhost_override.golden @@ -0,0 +1,5 @@ +nameserver 127.0.0.11 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [127.0.0.53] +# Overrides: [nameservers] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_only.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_only.golden new file mode 100644 index 000000000000..58dadc47fb7e --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv4_only.golden @@ -0,0 +1,5 @@ +nameserver 127.0.0.11 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [host(10.0.0.1)] +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv6_only.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv6_only.golden new file mode 100644 index 000000000000..3dd9cf69e88f --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/IPv6_only.golden @@ -0,0 +1,5 @@ +nameserver 127.0.0.11 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [host(fd14:6e0e:f855::1)] +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/No_config.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/No_config.golden new file mode 100644 index 000000000000..253fecad24c9 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/No_config.golden @@ -0,0 +1,5 @@ +nameserver 127.0.0.11 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# NO EXTERNAL NAMESERVERS DEFINED +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_host,_override_and_required.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_host,_override_and_required.golden new file mode 100644 index 000000000000..dc469d58cda0 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_host,_override_and_required.golden @@ -0,0 +1,7 @@ +nameserver 127.0.0.11 +options ndots:2 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [host(127.0.0.53)] +# Overrides: [options] +# Option ndots from: override diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_missing_but_required.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_missing_but_required.golden new file mode 100644 index 000000000000..827ecd295cb2 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_missing_but_required.golden @@ -0,0 +1,7 @@ +nameserver 127.0.0.11 +options ndots:0 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [host(127.0.0.53)] +# Overrides: [] +# Option ndots from: internal diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_present_and_required.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_present_and_required.golden new file mode 100644 index 000000000000..d005fa38b6b3 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForIntNS/ndots_present_and_required.golden @@ -0,0 +1,7 @@ +nameserver 127.0.0.11 +options ndots:1 + +# Based on host file: '/etc/resolv.conf' (internal resolver) +# ExtServers: [host(127.0.0.53)] +# Overrides: [] +# Option ndots from: host diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_disabled.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_disabled.golden new file mode 100644 index 000000000000..165eafe282b9 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_disabled.golden @@ -0,0 +1,6 @@ +nameserver 8.8.8.8 +nameserver 8.8.4.4 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Used default nameservers. +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_enabled.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_enabled.golden new file mode 100644 index 000000000000..fd66dad64e48 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_and_IPv6_localhost,_ipv6_enabled.golden @@ -0,0 +1,8 @@ +nameserver 8.8.8.8 +nameserver 8.8.4.4 +nameserver 2001:4860:4860::8888 +nameserver 2001:4860:4860::8844 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Used default nameservers. +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_disabled.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_disabled.golden new file mode 100644 index 000000000000..165eafe282b9 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_disabled.golden @@ -0,0 +1,6 @@ +nameserver 8.8.8.8 +nameserver 8.8.4.4 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Used default nameservers. +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_enabled.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_enabled.golden new file mode 100644 index 000000000000..c188830fcd88 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_IPv6_routeable,_ipv6_enabled.golden @@ -0,0 +1,4 @@ +nameserver fd3e:2d1a:1f5a::1 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_disabled.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_disabled.golden new file mode 100644 index 000000000000..165eafe282b9 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_disabled.golden @@ -0,0 +1,6 @@ +nameserver 8.8.8.8 +nameserver 8.8.4.4 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Used default nameservers. +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_enabled.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_enabled.golden new file mode 100644 index 000000000000..fd66dad64e48 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/IPv4_localhost,_ipv6_enabled.golden @@ -0,0 +1,8 @@ +nameserver 8.8.8.8 +nameserver 8.8.4.4 +nameserver 2001:4860:4860::8888 +nameserver 2001:4860:4860::8844 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Used default nameservers. +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Override_nameservers.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Override_nameservers.golden new file mode 100644 index 000000000000..74f7abf96873 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Override_nameservers.golden @@ -0,0 +1,5 @@ +nameserver 127.0.0.1 +nameserver ::1 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Overrides: [nameservers] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_disabled.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_disabled.golden new file mode 100644 index 000000000000..cdeaadf88cd1 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_disabled.golden @@ -0,0 +1,4 @@ +nameserver 10.0.0.1 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_enabled.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_enabled.golden new file mode 100644 index 000000000000..e00cad933355 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_and_IPv6,_ipv6_enabled.golden @@ -0,0 +1,5 @@ +nameserver 10.0.0.1 +nameserver fdb6:b8fe:b528::1 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_only.golden b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_only.golden new file mode 100644 index 000000000000..cdeaadf88cd1 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCTransformForLegacyNw/Routable_IPv4_only.golden @@ -0,0 +1,4 @@ +nameserver 10.0.0.1 + +# Based on host file: '/etc/resolv.conf' (legacy) +# Overrides: [] diff --git a/executor/oci/internal/resolvconf/testdata/TestRCUnknownDirectives.golden b/executor/oci/internal/resolvconf/testdata/TestRCUnknownDirectives.golden new file mode 100644 index 000000000000..4fc961c558b4 --- /dev/null +++ b/executor/oci/internal/resolvconf/testdata/TestRCUnknownDirectives.golden @@ -0,0 +1,8 @@ +nameserver 127.0.0.53 +options ndots:1 +something unexpected +unrecognised thing + +# Based on host file: '/etc/resolv.conf' +# Overrides: [] +# Option ndots from: host diff --git a/executor/oci/internal/resolvconf/utils_test.go b/executor/oci/internal/resolvconf/utils_test.go new file mode 100644 index 000000000000..b982557c9236 --- /dev/null +++ b/executor/oci/internal/resolvconf/utils_test.go @@ -0,0 +1,42 @@ +package resolvconf + +import ( + "flag" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// allow running "go test -v -update ." to update golden files. +var updateGolden = flag.Bool("update", false, "update golden files") + +func TestMain(m *testing.M) { + flag.Parse() + os.Exit(m.Run()) +} + +func assertGolden(t *testing.T, goldenFile string, actual string) { + t.Helper() + goldenFile = filepath.Join("testdata", goldenFile) + + if *updateGolden { + require.NoError(t, os.WriteFile(goldenFile, []byte(actual), 0644)) + } + expected, err := os.ReadFile(goldenFile) + require.NoError(t, err) + assert.Equal(t, string(expected), actual) +} + +// taken from https://github.com/moby/moby/blob/9af9d2742cc751c38900efaa385968c75ff3fdd7/internal/sliceutil/sliceutil.go#L26-L34 +func sliceutilMapper[In, Out any](fn func(In) Out) func([]In) []Out { + return func(s []In) []Out { + res := make([]Out, len(s)) + for i, v := range s { + res[i] = fn(v) + } + return res + } +} diff --git a/executor/oci/resolvconf.go b/executor/oci/resolvconf.go index 8354d101ccc5..936fa7671317 100644 --- a/executor/oci/resolvconf.go +++ b/executor/oci/resolvconf.go @@ -2,10 +2,11 @@ package oci import ( "context" + "net/netip" "os" "path/filepath" - "github.com/docker/docker/libnetwork/resolvconf" + "github.com/moby/buildkit/executor/oci/internal/resolvconf" "github.com/moby/buildkit/solver/pb" "github.com/moby/buildkit/util/flightcontrol" "github.com/moby/sys/user" @@ -76,41 +77,40 @@ func GetResolvConf(ctx context.Context, stateDir string, idmap *user.IdentityMap return struct{}{}, nil } - dt, err := os.ReadFile(resolvconfPath(netMode)) + rc, err := resolvconf.Load(resolvconfPath(netMode)) if err != nil && !errors.Is(err, os.ErrNotExist) { return struct{}{}, errors.WithStack(err) } - tmpPath := p + ".tmp" if dns != nil { - var ( - dnsNameservers = dns.Nameservers - dnsSearchDomains = dns.SearchDomains - dnsOptions = dns.Options - ) - if len(dns.Nameservers) == 0 { - dnsNameservers = resolvconf.GetNameservers(dt, resolvconf.IP) + if len(dns.Nameservers) > 0 { + var ns []netip.Addr + for _, addr := range dns.Nameservers { + ipAddr, err := netip.ParseAddr(addr) + if err != nil { + return struct{}{}, errors.WithStack(errors.Wrap(err, "bad nameserver address")) + } + ns = append(ns, ipAddr) + } + rc.OverrideNameServers(ns) } - if len(dns.SearchDomains) == 0 { - dnsSearchDomains = resolvconf.GetSearchDomains(dt) + if len(dns.SearchDomains) > 0 { + rc.OverrideSearch(dns.SearchDomains) } - if len(dns.Options) == 0 { - dnsOptions = resolvconf.GetOptions(dt) + if len(dns.Options) > 0 { + rc.OverrideOptions(dns.Options) } + } - f, err := resolvconf.Build(tmpPath, dnsNameservers, dnsSearchDomains, dnsOptions) - if err != nil { - return struct{}{}, errors.WithStack(err) - } - dt = f.Content + if netMode != pb.NetMode_HOST || len(rc.NameServers()) == 0 { + rc.TransformForLegacyNw(true) } - if netMode != pb.NetMode_HOST || len(resolvconf.GetNameservers(dt, resolvconf.IP)) == 0 { - f, err := resolvconf.FilterResolvDNS(dt, true) - if err != nil { - return struct{}{}, errors.WithStack(err) - } - dt = f.Content + tmpPath := p + ".tmp" + + dt, err := rc.Generate(false) + if err != nil { + return struct{}{}, errors.WithStack(err) } if err := os.WriteFile(tmpPath, dt, 0644); err != nil { @@ -124,6 +124,7 @@ func GetResolvConf(ctx context.Context, stateDir string, idmap *user.IdentityMap } } + // TODO(thaJeztah): can we avoid the write -> chown -> rename? if err := os.Rename(tmpPath, p); err != nil { return struct{}{}, errors.WithStack(err) } diff --git a/executor/oci/spec_linux.go b/executor/oci/spec_linux.go index 2e80c8557e7c..0ccd3b3ba628 100644 --- a/executor/oci/spec_linux.go +++ b/executor/oci/spec_linux.go @@ -14,12 +14,12 @@ import ( "github.com/containerd/containerd/v2/pkg/oci" cdseccomp "github.com/containerd/containerd/v2/pkg/seccomp" "github.com/containerd/continuity/fs" - "github.com/docker/docker/profiles/seccomp" "github.com/moby/buildkit/snapshot" "github.com/moby/buildkit/solver/llbsolver/cdidevices" "github.com/moby/buildkit/solver/pb" "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/entitlements/security" + "github.com/moby/profiles/seccomp" "github.com/moby/sys/user" specs "github.com/opencontainers/runtime-spec/specs-go" selinux "github.com/opencontainers/selinux/go-selinux" diff --git a/go.mod b/go.mod index 138068c01d07..b7445915acb2 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,6 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 github.com/distribution/reference v0.6.0 github.com/docker/cli v28.2.2+incompatible - github.com/docker/docker v28.2.2+incompatible github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 github.com/gofrs/flock v0.12.1 @@ -52,6 +51,7 @@ require ( github.com/moby/go-archive v0.1.0 github.com/moby/locker v1.0.1 github.com/moby/patternmatcher v0.6.0 + github.com/moby/profiles/seccomp v0.1.0 github.com/moby/sys/mountinfo v0.7.2 github.com/moby/sys/reexec v0.1.0 github.com/moby/sys/signal v0.7.1 @@ -143,6 +143,7 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect + github.com/docker/docker v28.2.2+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/felixge/fgprof v0.9.3 // indirect @@ -160,7 +161,6 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/moby/sys/atomicwriter v0.1.0 // indirect github.com/moby/sys/mount v0.3.4 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect diff --git a/go.sum b/go.sum index 9b55c1bbce70..4e36b24faf6b 100644 --- a/go.sum +++ b/go.sum @@ -281,8 +281,8 @@ github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= -github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= -github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= +github.com/moby/profiles/seccomp v0.1.0 h1:kVf1lc5ytNB1XPxEdZUVF+oPpbBYJHR50eEvPt/9k8A= +github.com/moby/profiles/seccomp v0.1.0/go.mod h1:Kqk57vxH6/wuOc5bmqRiSXJ6iEz8Pvo3LQRkv0ytFWs= github.com/moby/sys/mount v0.3.4 h1:yn5jq4STPztkkzSKpZkLcmjue+bZJ0u2AuQY1iNI1Ww= github.com/moby/sys/mount v0.3.4/go.mod h1:KcQJMbQdJHPlq5lcYT+/CjatWM4PuxKe+XLSVS4J6Os= github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= diff --git a/vendor/github.com/docker/docker/AUTHORS b/vendor/github.com/docker/docker/AUTHORS deleted file mode 100644 index c7c649471c2d..000000000000 --- a/vendor/github.com/docker/docker/AUTHORS +++ /dev/null @@ -1,2496 +0,0 @@ -# File @generated by hack/generate-authors.sh. DO NOT EDIT. -# This file lists all contributors to the repository. -# See hack/generate-authors.sh to make modifications. - -17neverends -7sunarni <710720732@qq.com> -Aanand Prasad -Aarni Koskela -Aaron Davidson -Aaron Feng -Aaron Hnatiw -Aaron Huslage -Aaron L. Xu -Aaron Lehmann -Aaron Welch -Aaron Yoshitake -Abdur Rehman -Abel Muiño -Abhijeet Kasurde -Abhinandan Prativadi -Abhinav Ajgaonkar -Abhishek Chanda -Abhishek Sharma -Abin Shahab -Abirdcfly -Ada Mancini -Adam Avilla -Adam Dobrawy -Adam Eijdenberg -Adam Kunk -Adam Lamers -Adam Miller -Adam Mills -Adam Pointer -Adam Simon -Adam Singer -Adam Thornton -Adam Walz -Adam Williams -AdamKorcz -Addam Hardy -Aditi Rajagopal -Aditya -Adnan Khan -Adolfo Ochagavía -Adria Casas -Adrian Moisey -Adrian Mouat -Adrian Oprea -Adrien Folie -Adrien Gallouët -Ahmed Kamal -Ahmet Alp Balkan -Aidan Feldman -Aidan Hobson Sayers -AJ Bowen -Ajey Charantimath -ajneu -Akash Gupta -Akhil Mohan -Akihiro Matsushima -Akihiro Suda -Akim Demaille -Akira Koyasu -Akshay Karle -Akshay Moghe -Al Tobey -alambike -Alan Hoyle -Alan Scherger -Alan Thompson -Alano Terblanche -Albert Callarisa -Albert Zhang -Albin Kerouanton -Alec Benson -Alejandro González Hevia -Aleksa Sarai -Aleksandr Chebotov -Aleksandrs Fadins -Alena Prokharchyk -Alessandro Boch -Alessio Biancalana -Alex Chan -Alex Chen -Alex Coventry -Alex Crawford -Alex Ellis -Alex Gaynor -Alex Goodman -Alex Nordlund -Alex Olshansky -Alex Samorukov -Alex Stockinger -Alex Warhawk -Alexander Artemenko -Alexander Boyd -Alexander Larsson -Alexander Midlash -Alexander Morozov -Alexander Polakov -Alexander Shopov -Alexandre Beslic -Alexandre Garnier -Alexandre González -Alexandre Jomin -Alexandru Sfirlogea -Alexei Margasov -Alexey Guskov -Alexey Kotlyarov -Alexey Shamrin -Alexis Ries -Alexis Thomas -Alfred Landrum -Ali Dehghani -Alicia Lauerman -Alihan Demir -Allen Madsen -Allen Sun -almoehi -Alvaro Saurin -Alvin Deng -Alvin Richards -amangoel -Amen Belayneh -Ameya Gawde -Amir Goldstein -AmirBuddy -Amit Bakshi -Amit Krishnan -Amit Shukla -Amr Gawish -Amy Lindburg -Anand Patil -AnandkumarPatel -Anatoly Borodin -Anca Iordache -Anchal Agrawal -Anda Xu -Anders Janmyr -Andre Dublin <81dublin@gmail.com> -Andre Granovsky -Andrea Denisse Gómez -Andrea Luzzardi -Andrea Turli -Andreas Elvers -Andreas Köhler -Andreas Savvides -Andreas Tiefenthaler -Andrei Gherzan -Andrei Ushakov -Andrei Vagin -Andrew Baxter <423qpsxzhh8k3h@s.rendaw.me> -Andrew C. Bodine -Andrew Clay Shafer -Andrew Duckworth -Andrew France -Andrew Gerrand -Andrew Guenther -Andrew He -Andrew Hsu -Andrew Kim -Andrew Kuklewicz -Andrew Macgregor -Andrew Macpherson -Andrew Martin -Andrew McDonnell -Andrew Munsell -Andrew Pennebaker -Andrew Po -Andrew Weiss -Andrew Williams -Andrews Medina -Andrey Kolomentsev -Andrey Petrov -Andrey Stolbovsky -André Martins -Andrés Maldonado -Andy Chambers -andy diller -Andy Goldstein -Andy Kipp -Andy Lindeman -Andy Rothfusz -Andy Smith -Andy Wilson -Andy Zhang -Aneesh Kulkarni -Anes Hasicic -Angel Velazquez -Anil Belur -Anil Madhavapeddy -Anirudh Aithal -Ankit Jain -Ankush Agarwal -Anonmily -Anran Qiao -Anshul Pundir -Anthon van der Neut -Anthony Baire -Anthony Bishopric -Anthony Dahanne -Anthony Sottile -Anton Löfgren -Anton Nikitin -Anton Polonskiy -Anton Tiurin -Antonio Aguilar -Antonio Murdaca -Antonis Kalipetis -Antony Messerli -Anuj Bahuguna -Anuj Varma -Anusha Ragunathan -Anyu Wang -apocas -Arash Deshmeh -arcosx -ArikaChen -Arko Dasgupta -Arnaud Lefebvre -Arnaud Porterie -Arnaud Rebillout -Artem Khramov -Arthur Barr -Arthur Gautier -Artur Meyster -Arun Gupta -Asad Saeeduddin -Asbjørn Enge -Ashly Mathew -Austin Vazquez -averagehuman -Avi Das -Avi Kivity -Avi Miller -Avi Vaid -Azat Khuyiyakhmetov -Bao Yonglei -Bardia Keyoumarsi -Barnaby Gray -Barry Allard -Bartłomiej Piotrowski -Bastiaan Bakker -Bastien Pascard -bdevloed -Bearice Ren -Ben Bonnefoy -Ben Firshman -Ben Golub -Ben Gould -Ben Hall -Ben Langfeld -Ben Lovy -Ben Sargent -Ben Severson -Ben Toews -Ben Wiklund -Benjamin Atkin -Benjamin Baker -Benjamin Boudreau -Benjamin Böhmke -Benjamin Wang -Benjamin Yolken -Benny Ng -Benoit Chesneau -Bernerd Schaefer -Bernhard M. Wiedemann -Bert Goethals -Bertrand Roussel -Bevisy Zhang -Bharath Thiruveedula -Bhiraj Butala -Bhumika Bayani -Bilal Amarni -Bill Wang -Billy Ridgway -Bily Zhang -Bin Liu -Bingshen Wang -Bjorn Neergaard -Blake Geno -Boaz Shuster -bobby abbott -Bojun Zhu -Boqin Qin -Boris Pruessmann -Boshi Lian -Bouke Haarsma -Boyd Hemphill -boynux -Bradley Cicenas -Bradley Wright -Brandon Liu -Brandon Philips -Brandon Rhodes -Brendan Dixon -Brendon Smith -Brennan Kinney <5098581+polarathene@users.noreply.github.com> -Brent Salisbury -Brett Higgins -Brett Kochendorfer -Brett Milford -Brett Randall -Brian (bex) Exelbierd -Brian Bland -Brian DeHamer -Brian Dorsey -Brian Flad -Brian Goff -Brian McCallister -Brian Olsen -Brian Schwind -Brian Shumate -Brian Torres-Gil -Brian Trump -Brice Jaglin -Briehan Lombaard -Brielle Broder -Bruno Bigras -Bruno Binet -Bruno Gazzera -Bruno Renié -Bruno Tavares -Bryan Bess -Bryan Boreham -Bryan Matsuo -Bryan Murphy -Burke Libbey -Byung Kang -Caleb Spare -Calen Pennington -Calvin Liu -Cameron Boehmer -Cameron Sparr -Cameron Spear -Campbell Allen -Candid Dauth -Cao Weiwei -Carl Henrik Lunde -Carl Loa Odin -Carl X. Su -Carlo Mion -Carlos Alexandro Becker -Carlos de Paula -Carlos Sanchez -Carol Fager-Higgins -Cary -Casey Bisson -Catalin Pirvu -Ce Gao -Cedric Davies -Cesar Talledo -Cezar Sa Espinola -Chad Swenson -Chance Zibolski -Chander Govindarajan -Chanhun Jeong -Chao Wang -Charity Kathure -Charles Chan -Charles Hooper -Charles Law -Charles Lindsay -Charles Merriam -Charles Sarrazin -Charles Smith -Charlie Drage -Charlie Lewis -Chase Bolt -ChaYoung You -Chee Hau Lim -Chen Chao -Chen Chuanliang -Chen Hanxiao -Chen Min -Chen Mingjie -Chen Qiu -Cheng-mean Liu -Chengfei Shang -Chengguang Xu -Chengyu Zhu -Chentianze -Chenyang Yan -chenyuzhu -Chetan Birajdar -Chewey -Chia-liang Kao -Chiranjeevi Tirunagari -chli -Cholerae Hu -Chris Alfonso -Chris Armstrong -Chris Dias -Chris Dituri -Chris Fordham -Chris Gavin -Chris Gibson -Chris Khoo -Chris Kreussling (Flatbush Gardener) -Chris McKinnel -Chris McKinnel -Chris Price -Chris Seto -Chris Snow -Chris St. Pierre -Chris Stivers -Chris Swan -Chris Telfer -Chris Wahl -Chris Weyl -Chris White -Christian Becker -Christian Berendt -Christian Brauner -Christian Böhme -Christian Muehlhaeuser -Christian Persson -Christian Rotzoll -Christian Simon -Christian Stefanescu -Christoph Ziebuhr -Christophe Mehay -Christophe Troestler -Christophe Vidal -Christopher Biscardi -Christopher Crone -Christopher Currie -Christopher Jones -Christopher Latham -Christopher Petito -Christopher Rigor -Christy Norman -Chun Chen -Ciro S. Costa -Clayton Coleman -Clint Armstrong -Clinton Kitson -clubby789 -Cody Roseborough -Coenraad Loubser -Colin Dunklau -Colin Hebert -Colin Panisset -Colin Rice -Colin Walters -Collin Guarino -Colm Hally -companycy -Conor Evans -Corbin Coleman -Corey Farrell -Cory Forsyth -Cory Snider -cressie176 -Cristian Ariza -Cristian Staretu -cristiano balducci -Cristina Yenyxe Gonzalez Garcia -Cruceru Calin-Cristian -cui fliter -CUI Wei -Cuong Manh Le -Cyprian Gracz -Cyril F -Da McGrady -Daan van Berkel -Daehyeok Mun -Dafydd Crosby -dalanlan -Damian Smyth -Damien Nadé -Damien Nozay -Damjan Georgievski -Dan Anolik -Dan Buch -Dan Cotora -Dan Feldman -Dan Griffin -Dan Hirsch -Dan Keder -Dan Levy -Dan McPherson -Dan Plamadeala -Dan Stine -Dan Williams -Dani Hodovic -Dani Louca -Daniel Antlinger -Daniel Black -Daniel Dao -Daniel Exner -Daniel Farrell -Daniel Garcia -Daniel Gasienica -Daniel Grunwell -Daniel Guns -Daniel Helfand -Daniel Hiltgen -Daniel J Walsh -Daniel Menet -Daniel Mizyrycki -Daniel Nephin -Daniel Norberg -Daniel Nordberg -Daniel P. Berrangé -Daniel Robinson -Daniel S -Daniel Sweet -Daniel Von Fange -Daniel Watkins -Daniel X Moore -Daniel YC Lin -Daniel Zhang -Daniele Rondina -Danny Berger -Danny Milosavljevic -Danny Yates -Danyal Khaliq -Darren Coxall -Darren Shepherd -Darren Stahl -Dattatraya Kumbhar -Davanum Srinivas -Dave Barboza -Dave Goodchild -Dave Henderson -Dave MacDonald -Dave Tucker -David Anderson -David Bellotti -David Calavera -David Chung -David Corking -David Cramer -David Currie -David Davis -David Dooling -David Gageot -David Gebler -David Glasser -David Karlsson <35727626+dvdksn@users.noreply.github.com> -David Lawrence -David Lechner -David M. Karr -David Mackey -David Manouchehri -David Mat -David Mcanulty -David McKay -David O'Rourke -David P Hilton -David Pelaez -David R. Jenni -David Röthlisberger -David Sheets -David Sissitka -David Trott -David Wang <00107082@163.com> -David Williamson -David Xia -David Young -Davide Ceretti -Dawn Chen -dbdd -dcylabs -Debayan De -Deborah Gertrude Digges -deed02392 -Deep Debroy -Deng Guangxing -Deni Bertovic -Denis Defreyne -Denis Gladkikh -Denis Ollier -Dennis Chen -Dennis Chen -Dennis Docter -Derek -Derek -Derek Ch -Derek McGowan -Deric Crago -Deshi Xiao -Devon Estes -Devvyn Murphy -Dharmit Shah -Dhawal Yogesh Bhanushali -Dhilip Kumars -Diego Romero -Diego Siqueira -Dieter Reuter -Dillon Dixon -Dima Stopel -Dimitri John Ledkov -Dimitris Mandalidis -Dimitris Rozakis -Dimitry Andric -Dinesh Subhraveti -Ding Fei -dingwei -Diogo Monica -DiuDiugirl -Djibril Koné -Djordje Lukic -dkumor -Dmitri Logvinenko -Dmitri Shuralyov -Dmitry Demeshchuk -Dmitry Gusev -Dmitry Kononenko -Dmitry Sharshakov -Dmitry Shyshkin -Dmitry Smirnov -Dmitry V. Krivenok -Dmitry Vorobev -Dmytro Iakovliev -docker-unir[bot] -Dolph Mathews -Dominic Tubach -Dominic Yin -Dominik Dingel -Dominik Finkbeiner -Dominik Honnef -Don Kirkby -Don Kjer -Don Spaulding -Donald Huang -Dong Chen -Donghwa Kim -Donovan Jones -Dorin Geman -Doron Podoleanu -Doug Davis -Doug MacEachern -Doug Tangren -Douglas Curtis -Dr Nic Williams -dragon788 -Dražen Lučanin -Drew Erny -Drew Hubl -Dustin Sallings -Ed Costello -Edmund Wagner -Eiichi Tsukata -Eike Herzbach -Eivin Giske Skaaren -Eivind Uggedal -Elan Ruusamäe -Elango Sivanandam -Elena Morozova -Eli Uriegas -Elias Faxö -Elias Koromilas -Elias Probst -Elijah Zupancic -eluck -Elvir Kuric -Emil Davtyan -Emil Hernvall -Emily Maier -Emily Rose -Emir Ozer -Eng Zer Jun -Enguerran -Enrico Weigelt, metux IT consult -Eohyung Lee -epeterso -er0k -Eric Barch -Eric Curtin -Eric G. Noriega -Eric Hanchrow -Eric Lee -Eric Mountain -Eric Myhre -Eric Paris -Eric Rafaloff -Eric Rosenberg -Eric Sage -Eric Soderstrom -Eric Yang -Eric-Olivier Lamey -Erica Windisch -Erich Cordoba -Erik Bray -Erik Dubbelboer -Erik Hollensbe -Erik Inge Bolsø -Erik Kristensen -Erik Sipsma -Erik Sjölund -Erik St. Martin -Erik Weathers -Erno Hopearuoho -Erwin van der Koogh -Espen Suenson -Ethan Bell -Ethan Mosbaugh -Euan Harris -Euan Kemp -Eugen Krizo -Eugene Yakubovich -Evan Allrich -Evan Carmi -Evan Hazlett -Evan Krall -Evan Lezar -Evan Phoenix -Evan Wies -Evelyn Xu -Everett Toews -Evgeniy Makhrov -Evgeny Shmarnev -Evgeny Vereshchagin -Ewa Czechowska -Eystein Måløy Stenberg -ezbercih -Ezra Silvera -Fabian Kramm -Fabian Lauer -Fabian Raetz -Fabiano Rosas -Fabio Falci -Fabio Kung -Fabio Rapposelli -Fabio Rehm -Fabrizio Regini -Fabrizio Soppelsa -Faiz Khan -falmp -Fangming Fang -Fangyuan Gao <21551127@zju.edu.cn> -fanjiyun -Fareed Dudhia -Fathi Boudra -Federico Gimenez -Felipe Oliveira -Felipe Ruhland -Felix Abecassis -Felix Geisendörfer -Felix Hupfeld -Felix Rabe -Felix Ruess -Felix Schindler -Feng Yan -Fengtu Wang -Ferenc Szabo -Fernando -Fero Volar -Feroz Salam -Ferran Rodenas -Filipe Brandenburger -Filipe Oliveira -Filipe Pina -Flavio Castelli -Flavio Crisciani -Florian -Florian Klein -Florian Maier -Florian Noeding -Florian Schmaus -Florian Weingarten -Florin Asavoaie -Florin Patan -fonglh -Foysal Iqbal -Francesc Campoy -Francesco Degrassi -Francesco Mari -Francis Chuang -Francisco Carriedo -Francisco Souza -Frank Groeneveld -Frank Herrmann -Frank Macreery -Frank Rosquin -Frank Villaro-Dixon -Frank Yang -François Scala -Fred Lifton -Frederick F. Kautz IV -Frederico F. de Oliveira -Frederik Loeffert -Frederik Nordahl Jul Sabroe -Freek Kalter -Frieder Bluemle -frobnicaty <92033765+frobnicaty@users.noreply.github.com> -Frédéric Dalleau -Fu JinLin -Félix Baylac-Jacqué -Félix Cantournet -Gabe Rosenhouse -Gabor Nagy -Gabriel Adrian Samfira -Gabriel Goller -Gabriel L. Somlo -Gabriel Linder -Gabriel Monroy -Gabriel Nicolas Avellaneda -Gabriel Tomitsuka -Gaetan de Villele -Galen Sampson -Gang Qiao -Gareth Rushgrove -Garrett Barboza -Gary Schaetz -Gaurav -Gaurav Singh -Gaël PORTAY -Genki Takiuchi -GennadySpb -Geoff Levand -Geoffrey Bachelet -Geon Kim -George Adams -George Kontridze -George Ma -George MacRorie -George Xie -Georgi Hristozov -Georgy Yakovlev -Gereon Frey -German DZ -Gert van Valkenhoef -Gerwim Feiken -Ghislain Bourgeois -Giampaolo Mancini -Gianluca Borello -Gildas Cuisinier -Giovan Isa Musthofa -gissehel -Giuseppe Mazzotta -Giuseppe Scrivano -Gleb Fotengauer-Malinovskiy -Gleb M Borisov -Glyn Normington -GoBella -Goffert van Gool -Goldwyn Rodrigues -Gopikannan Venugopalsamy -Gosuke Miyashita -Gou Rao -Govinda Fichtner -Grace Choi -Grant Millar -Grant Reaber -Graydon Hoare -Greg Fausak -Greg Pflaum -Greg Stephens -Greg Thornton -Grzegorz Jaśkiewicz -Guilhem Lettron -Guilherme Salgado -Guillaume Dufour -Guillaume J. Charmes -Gunadhya S. <6939749+gunadhya@users.noreply.github.com> -Guoqiang QI -guoxiuyan -Guri -Gurjeet Singh -Guruprasad -Gustav Sinder -gwx296173 -Günter Zöchbauer -Haichao Yang -haikuoliu -haining.cao -Hakan Özler -Hamish Hutchings -Hannes Ljungberg -Hans Kristian Flaatten -Hans Rødtang -Hao Shu Wei -Hao Zhang <21521210@zju.edu.cn> -Harald Albers -Harald Niesche -Harley Laue -Harold Cooper -Harrison Turton -Harry Zhang -Harshal Patil -Harshal Patil -He Simei -He Xiaoxi -He Xin -heartlock <21521209@zju.edu.cn> -Hector Castro -Helen Xie -Henning Sprang -Hiroshi Hatake -Hiroyuki Sasagawa -Hobofan -Hollie Teal -Hong Xu -Hongbin Lu -Hongxu Jia -Honza Pokorny -Hsing-Hui Hsu -Hsing-Yu (David) Chen -hsinko <21551195@zju.edu.cn> -Hu Keping -Hu Tao -Huajin Tong -huang-jl <1046678590@qq.com> -HuanHuan Ye -Huanzhong Zhang -Huayi Zhang -Hugo Barrera -Hugo Duncan -Hugo Marisco <0x6875676f@gmail.com> -Hui Kang -Hunter Blanks -huqun -Huu Nguyen -Hyeongkyu Lee -Hyzhou Zhy -Iago López Galeiras -Ian Bishop -Ian Bull -Ian Calvert -Ian Campbell -Ian Chen -Ian Lee -Ian Main -Ian Philpot -Ian Truslove -Iavael -Icaro Seara -Ignacio Capurro -Igor Dolzhikov -Igor Karpovich -Iliana Weller -Ilkka Laukkanen -Illia Antypenko -Illo Abdulrahim -Ilya Dmitrichenko -Ilya Gusev -Ilya Khlopotov -imalasong <2879499479@qq.com> -imre Fitos -inglesp -Ingo Gottwald -Innovimax -Isaac Dupree -Isabel Jimenez -Isaiah Grace -Isao Jonas -Iskander Sharipov -Ivan Babrou -Ivan Fraixedes -Ivan Grcic -Ivan Markin -J Bruni -J. Nunn -Jack Danger Canty -Jack Laxson -Jack Walker <90711509+j2walker@users.noreply.github.com> -Jacob Atzen -Jacob Edelman -Jacob Tomlinson -Jacob Vallejo -Jacob Wen -Jaime Cepeda -Jaivish Kothari -Jake Champlin -Jake Moshenko -Jake Sanders -Jakub Drahos -Jakub Guzik -James Allen -James Carey -James Carr -James DeFelice -James Harrison Fisher -James Kyburz -James Kyle -James Lal -James Mills -James Nesbitt -James Nugent -James Sanders -James Turnbull -James Watkins-Harvey -Jameson Hyde -Jamie Hannaford -Jamshid Afshar -Jan Breig -Jan Chren -Jan Garcia -Jan Götte -Jan Keromnes -Jan Koprowski -Jan Pazdziora -Jan Toebes -Jan-Gerd Tenberge -Jan-Jaap Driessen -Jana Radhakrishnan -Jannick Fahlbusch -Januar Wayong -Jared Biel -Jared Hocutt -Jaroslav Jindrak -Jaroslaw Zabiello -Jasmine Hegman -Jason A. Donenfeld -Jason Divock -Jason Giedymin -Jason Green -Jason Hall -Jason Heiss -Jason Livesay -Jason McVetta -Jason Plum -Jason Shepherd -Jason Smith -Jason Sommer -Jason Stangroome -Jasper Siepkes -Javier Bassi -jaxgeller -Jay -Jay Kamat -Jay Lim -Jean Rouge -Jean-Baptiste Barth -Jean-Baptiste Dalido -Jean-Christophe Berthon -Jean-Michel Rouet -Jean-Paul Calderone -Jean-Pierre Huynh -Jean-Tiare Le Bigot -Jeeva S. Chelladhurai -Jeff Anderson -Jeff Hajewski -Jeff Johnston -Jeff Lindsay -Jeff Mickey -Jeff Minard -Jeff Nickoloff -Jeff Silberman -Jeff Welch -Jeff Zvier -Jeffrey Bolle -Jeffrey Morgan -Jeffrey van Gogh -Jenny Gebske -Jeongseok Kang -Jeremy Chambers -Jeremy Grosser -Jeremy Huntwork -Jeremy Price -Jeremy Qian -Jeremy Unruh -Jeremy Yallop -Jeroen Franse -Jeroen Jacobs -Jesse Dearing -Jesse Dubay -Jessica Frazelle -Jeyanthinath Muthuram -Jezeniel Zapanta -Jhon Honce -Ji.Zhilong -Jian Liao -Jian Zeng -Jian Zhang -Jiang Jinyang -Jianyong Wu -Jie Luo -Jie Ma -Jihyun Hwang -Jilles Oldenbeuving -Jim Alateras -Jim Carroll -Jim Ehrismann -Jim Galasyn -Jim Lin -Jim Minter -Jim Perrin -Jimmy Cuadra -Jimmy Puckett -Jimmy Song -jinjiadu -Jinsoo Park -Jintao Zhang -Jiri Appl -Jiri Popelka -Jiuyue Ma -Jiří Župka -jjimbo137 <115816493+jjimbo137@users.noreply.github.com> -Joakim Roubert -Joan Grau -Joao Fernandes -Joao Trindade -Joe Beda -Joe Doliner -Joe Ferguson -Joe Gordon -Joe Shaw -Joe Van Dyk -Joel Friedly -Joel Handwell -Joel Hansson -Joel Wurtz -Joey Geiger -Joey Geiger -Joey Gibson -Joffrey F -Johan Euphrosine -Johan Rydberg -Johanan Lieberman -Johannes 'fish' Ziemke -John Costa -John Feminella -John Gardiner Myers -John Gossman -John Harris -John Howard -John Laswell -John Maguire -John Mulhausen -John OBrien III -John Starks -John Stephens -John Tims -John V. Martinez -John Warwick -John Willis -Jon Johnson -Jon Surrell -Jon Wedaman -Jonas Dohse -Jonas Geiler -Jonas Heinrich -Jonas Pfenniger -Jonathan A. Schweder -Jonathan A. Sternberg -Jonathan Boulle -Jonathan Camp -Jonathan Choy -Jonathan Dowland -Jonathan Lebon -Jonathan Lomas -Jonathan McCrohan -Jonathan Mueller -Jonathan Pares -Jonathan Rudenberg -Jonathan Stoppani -Jonh Wendell -Joni Sar -Joost Cassee -Jordan Arentsen -Jordan Jennings -Jordan Sissel -Jordi Massaguer Pla -Jorge Marin -Jorit Kleine-Möllhoff -Jose Diaz-Gonzalez -Joseph Anthony Pasquale Holsten -Joseph Hager -Joseph Kern -Joseph Rothrock -Josh -Josh Bodah -Josh Bonczkowski -Josh Chorlton -Josh Eveleth -Josh Hawn -Josh Horwitz -Josh Poimboeuf -Josh Soref -Josh Wilson -Josiah Kiehl -José Tomás Albornoz -Joyce Jang -JP -JSchltggr -Julian Taylor -Julien Barbier -Julien Bisconti -Julien Bordellier -Julien Dubois -Julien Kassar -Julien Maitrehenry -Julien Pervillé -Julien Pivotto -Julio Guerra -Julio Montes -Jun Du -Jun-Ru Chang -junxu -Jussi Nummelin -Justas Brazauskas -Justen Martin -Justin Chadwell -Justin Cormack -Justin Force -Justin Keller <85903732+jk-vb@users.noreply.github.com> -Justin Menga -Justin Plock -Justin Simonelis -Justin Terry -Justyn Temme -Jyrki Puttonen -Jérémy Leherpeur -Jérôme Petazzoni -Jörg Thalheim -K. Heller -Kai Blin -Kai Qiang Wu (Kennan) -Kaijie Chen -Kaita Nakamura -Kamil Domański -Kamjar Gerami -Kanstantsin Shautsou -Kara Alexandra -Karan Lyons -Kareem Khazem -kargakis -Karl Grzeszczak -Karol Duleba -Karthik Karanth -Karthik Nayak -Kasper Fabæch Brandt -Kate Heddleston -Katie McLaughlin -Kato Kazuyoshi -Katrina Owen -Kawsar Saiyeed -Kay Yan -kayrus -Kazuhiro Sera -Kazuyoshi Kato -Ke Li -Ke Xu -Kei Ohmura -Keith Hudgins -Keli Hu -Ken Bannister -Ken Cochrane -Ken Herner -Ken ICHIKAWA -Ken Reese -Kenfe-Mickaël Laventure -Kenjiro Nakayama -Kent Johnson -Kenta Tada -Kevin "qwazerty" Houdebert -Kevin Alvarez -Kevin Burke -Kevin Clark -Kevin Feyrer -Kevin J. Lynagh -Kevin Jing Qiu -Kevin Kern -Kevin Menard -Kevin Meredith -Kevin P. Kucharczyk -Kevin Parsons -Kevin Richardson -Kevin Shi -Kevin Wallace -Kevin Yap -Keyvan Fatehi -kies -Kim BKC Carlbacker -Kim Eik -Kimbro Staken -Kir Kolyshkin -Kiran Gangadharan -Kirill SIbirev -Kirk Easterson -knappe -Kohei Tsuruta -Koichi Shiraishi -Konrad Kleine -Konrad Ponichtera -Konstantin Gribov -Konstantin L -Konstantin Pelykh -Kostadin Plachkov -kpcyrd -Krasi Georgiev -Krasimir Georgiev -Kris-Mikael Krister -Kristian Haugene -Kristian Heljas -Kristina Zabunova -Krystian Wojcicki -Kunal Kushwaha -Kunal Tyagi -Kyle Conroy -Kyle Linden -Kyle Squizzato -Kyle Wuolle -kyu -Lachlan Coote -Lai Jiangshan -Lajos Papp -Lakshan Perera -Lalatendu Mohanty -Lance Chen -Lance Kinley -Lars Andringa -Lars Butler -Lars Kellogg-Stedman -Lars R. Damerow -Lars-Magnus Skog -Laszlo Meszaros -Laura Brehm -Laura Frank -Laurent Bernaille -Laurent Erignoux -Laurent Goderre -Laurie Voss -Leandro Motta Barros -Leandro Siqueira -Lee Calcote -Lee Chao <932819864@qq.com> -Lee, Meng-Han -Lei Gong -Lei Jitang -Leiiwang -Len Weincier -Lennie -Leo Gallucci -Leonardo Nodari -Leonardo Taccari -Leszek Kowalski -Levi Blackstone -Levi Gross -Levi Harrison -Lewis Daly -Lewis Marshall -Lewis Peckover -Li Yi -Liam Macgillavry -Liana Lo -Liang Mingqiang -Liang-Chi Hsieh -liangwei -Liao Qingwei -Lifubang -Lihua Tang -Lily Guo -limeidan -Lin Lu -LingFaKe -Linus Heckemann -Liran Tal -Liron Levin -Liu Bo -Liu Hua -liwenqi -lixiaobing10051267 -Liz Zhang -LIZAO LI -Lizzie Dixon <_@lizzie.io> -Lloyd Dewolf -Lokesh Mandvekar -longliqiang88 <394564827@qq.com> -Lorenz Leutgeb -Lorenzo Fontana -Lotus Fenn -Louis Delossantos -Louis Opter -Luboslav Pivarc -Luca Favatella -Luca Marturana -Luca Orlandi -Luca-Bogdan Grigorescu -Lucas Chan -Lucas Chi -Lucas Molas -Lucas Silvestre -Luciano Mores -Luis Henrique Mulinari -Luis Martínez de Bartolomé Izquierdo -Luiz Svoboda -Lukas Heeren -Lukas Waslowski -lukaspustina -Lukasz Zajaczkowski -Luke Marsden -Lyn -Lynda O'Leary -Lénaïc Huard -Ma Müller -Ma Shimiao -Mabin -Madhan Raj Mookkandy -Madhav Puri -Madhu Venugopal -Mageee -maggie44 <64841595+maggie44@users.noreply.github.com> -Mahesh Tiyyagura -malnick -Malte Janduda -Manfred Touron -Manfred Zabarauskas -Manjunath A Kumatagi -Mansi Nahar -Manuel Meurer -Manuel Rüger -Manuel Woelker -mapk0y -Marat Radchenko -Marc Abramowitz -Marc Kuo -Marc Tamsky -Marcel Edmund Franke -Marcelo Horacio Fortino -Marcelo Salazar -Marco Hennings -Marcus Cobden -Marcus Farkas -Marcus Linke -Marcus Martins -Marcus Ramberg -Marek Goldmann -Marian Marinov -Marianna Tessel -Mario Loriedo -Marius Gundersen -Marius Sturm -Marius Voila -Mark Allen -Mark Feit -Mark Jeromin -Mark McGranaghan -Mark McKinstry -Mark Milstein -Mark Oates -Mark Parker -Mark Vainomaa -Mark West -Markan Patel -Marko Mikulicic -Marko Tibold -Markus Fix -Markus Kortlang -Martijn Dwars -Martijn van Oosterhout -Martin Braun -Martin Dojcak -Martin Honermeyer -Martin Jirku -Martin Kelly -Martin Mosegaard Amdisen -Martin Muzatko -Martin Redmond -Maru Newby -Mary Anthony -Masahito Zembutsu -Masato Ohba -Masayuki Morita -Mason Malone -Mateusz Sulima -Mathias Monnerville -Mathieu Champlon -Mathieu Le Marec - Pasquet -Mathieu Parent -Mathieu Paturel -Matt Apperson -Matt Bachmann -Matt Bajor -Matt Bentley -Matt Haggard -Matt Hoyle -Matt McCormick -Matt Moore -Matt Morrison <3maven@gmail.com> -Matt Richardson -Matt Rickard -Matt Robenolt -Matt Schurenko -Matt Williams -Matthew Heon -Matthew Lapworth -Matthew Mayer -Matthew Mosesohn -Matthew Mueller -Matthew Riley -Matthias Klumpp -Matthias Kühnle -Matthias Rampke -Matthieu Fronton -Matthieu Hauglustaine -Matthieu MOREL -Mattias Jernberg -Mauricio Garavaglia -mauriyouth -Max Harmathy -Max Shytikov -Max Timchenko -Maxim Fedchyshyn -Maxim Ivanov -Maxim Kulkin -Maxim Treskin -Maxime Petazzoni -Maximiliano Maccanti -Maxwell -Meaglith Ma -meejah -Megan Kostick -Mehul Kar -Mei ChunTao -Mengdi Gao -Menghui Chen -Mert Yazıcıoğlu -mgniu -Micah Zoltu -Michael A. Smith -Michael Beskin -Michael Bridgen -Michael Brown -Michael Chiang -Michael Crosby -Michael Currie -Michael Friis -Michael Gorsuch -Michael Grauer -Michael Holzheu -Michael Hudson-Doyle -Michael Huettermann -Michael Irwin -Michael Kebe -Michael Kuehn -Michael Käufl -Michael Neale -Michael Nussbaum -Michael Prokop -Michael Scharf -Michael Spetsiotis -Michael Stapelberg -Michael Steinert -Michael Thies -Michael Weidmann -Michael West -Michael Zhao -Michal Fojtik -Michal Gebauer -Michal Jemala -Michal Kostrzewa -Michal Minář -Michal Rostecki -Michal Wieczorek -Michaël Pailloncy -Michał Czeraszkiewicz -Michał Gryko -Michał Kosek -Michiel de Jong -Mickaël Fortunato -Mickaël Remars -Miguel Angel Fernández -Miguel Morales -Miguel Perez -Mihai Borobocea -Mihuleacc Sergiu -Mikael Davranche -Mike Brown -Mike Bush -Mike Casas -Mike Chelen -Mike Danese -Mike Dillon -Mike Dougherty -Mike Estes -Mike Gaffney -Mike Goelzer -Mike Leone -Mike Lundy -Mike MacCana -Mike Naberezny -Mike Snitzer -Mike Sul -mikelinjie <294893458@qq.com> -Mikhail Sobolev -Miklos Szegedi -Milas Bowman -Milind Chawre -Miloslav Trmač -mingqing -Mingzhen Feng -Misty Stanley-Jones -Mitch Capper -Mizuki Urushida -mlarcher -Mohammad Banikazemi -Mohammad Nasirifar -Mohammed Aaqib Ansari -Mohd Sadiq -Mohit Soni -Moorthy RS -Morgan Bauer -Morgante Pell -Morgy93 -Morten Siebuhr -Morton Fox -Moysés Borges -mrfly -Mrunal Patel -Muayyad Alsadi -Muhammad Zohaib Aslam -Mustafa Akın -Muthukumar R -Myeongjoon Kim -Máximo Cuadros -Médi-Rémi Hashim -Nace Oroz -Nahum Shalman -Nakul Pathak -Nalin Dahyabhai -Nan Monnand Deng -Naoki Orii -Natalie Parker -Natanael Copa -Natasha Jarus -Nate Brennand -Nate Eagleson -Nate Jones -Nathan Baulch -Nathan Carlson -Nathan Herald -Nathan Hsieh -Nathan Kleyn -Nathan LeClaire -Nathan McCauley -Nathan Williams -Naveed Jamil -Neal McBurnett -Neil Horman -Neil Peterson -Nelson Chen -Neyazul Haque -Nghia Tran -Niall O'Higgins -Nicholas E. Rabenau -Nick Adcock -Nick DeCoursin -Nick Irvine -Nick Neisen -Nick Parker -Nick Payne -Nick Russo -Nick Santos -Nick Stenning -Nick Stinemates -Nick Wood -NickrenREN -Nicola Kabar -Nicolas Borboën -Nicolas De Loof -Nicolas Dudebout -Nicolas Goy -Nicolas Kaiser -Nicolas Sterchele -Nicolas V Castet -Nicolás Hock Isaza -Niel Drummond -Nigel Poulton -Nik Nyby -Nikhil Chawla -NikolaMandic -Nikolas Garofil -Nikolay Edigaryev -Nikolay Milovanov -ningmingxiao -Nirmal Mehta -Nishant Totla -NIWA Hideyuki -Noah Meyerhans -Noah Treuhaft -NobodyOnSE -noducks -Nolan Darilek -Nolan Miles -Noriki Nakamura -nponeccop -Nurahmadie -Nuutti Kotivuori -nzwsch -O.S. Tezer -objectified -Octol1ttle -Odin Ugedal -Oguz Bilgic -Oh Jinkyun -Ohad Schneider -ohmystack -Ole Reifschneider -Oliver Neal -Oliver Reason -Olivier Gambier -Olle Jonsson -Olli Janatuinen -Olly Pomeroy -Omri Shiv -Onur Filiz -Oriol Francès -Oscar Bonilla <6f6231@gmail.com> -oscar.chen <2972789494@qq.com> -Oskar Niburski -Otto Kekäläinen -Ouyang Liduo -Ovidio Mallo -Panagiotis Moustafellos -Paolo G. Giarrusso -Pascal -Pascal Bach -Pascal Borreli -Pascal Hartig -Patrick Böänziger -Patrick Devine -Patrick Haas -Patrick Hemmer -Patrick St. laurent -Patrick Stapleton -Patrik Cyvoct -Patrik Leifert -pattichen -Paul "TBBle" Hampson -Paul -paul -Paul Annesley -Paul Bellamy -Paul Bowsher -Paul Furtado -Paul Hammond -Paul Jimenez -Paul Kehrer -Paul Lietar -Paul Liljenberg -Paul Morie -Paul Nasrat -Paul Seiffert -Paul Weaver -Paulo Gomes -Paulo Ribeiro -Pavel Lobashov -Pavel Matěja -Pavel Pletenev -Pavel Pospisil -Pavel Sutyrin -Pavel Tikhomirov -Pavlos Ratis -Pavol Vargovcik -Pawel Konczalski -Paweł Gronowski -payall4u -Peeyush Gupta -Peggy Li -Pei Su -Peng Tao -Penghan Wang -Per Weijnitz -perhapszzy@sina.com -Pete Woods -Peter Bourgon -Peter Braden -Peter Bücker -Peter Choi -Peter Dave Hello -Peter Edge -Peter Ericson -Peter Esbensen -Peter Jaffe -Peter Kang -Peter Malmgren -Peter Salvatore -Peter Volpe -Peter Waller -Petr Švihlík -Petros Angelatos -Phil -Phil Estes -Phil Sphicas -Phil Spitler -Philip Alexander Etling -Philip K. Warren -Philip Monroe -Philipp Fruck -Philipp Gillé -Philipp Wahala -Philipp Weissensteiner -Phillip Alexander -phineas -pidster -Piergiuliano Bossi -Pierre -Pierre Carrier -Pierre Dal-Pra -Pierre Wacrenier -Pierre-Alain RIVIERE -pinglanlu -Piotr Bogdan -Piotr Karbowski -Porjo -Poul Kjeldager Sørensen -Pradeep Chhetri -Pradip Dhara -Pradipta Kr. Banerjee -Prasanna Gautam -Pratik Karki -Prayag Verma -Priya Wadhwa -Projjol Banerji -Przemek Hejman -Puneet Pruthi -Pure White -pysqz -Qiang Huang -Qin TianHuan -Qinglan Peng -Quan Tian -qudongfang -Quentin Brossard -Quentin Perez -Quentin Tayssier -r0n22 -Rachit Sharma -Radostin Stoyanov -Rafael Fernández López -Rafal Jeczalik -Rafe Colton -Raghavendra K T -Raghuram Devarakonda -Raja Sami -Rajat Pandit -Rajdeep Dua -Ralf Sippl -Ralle -Ralph Bean -Ramkumar Ramachandra -Ramon Brooker -Ramon van Alteren -RaviTeja Pothana -Ray Tsang -ReadmeCritic -realityone -Recursive Madman -Reficul -Regan McCooey -Remi Rampin -Remy Suen -Renato Riccieri Santos Zannon -Renaud Gaubert -Rhys Hiltner -Ri Xu -Ricardo N Feliciano -Rich Horwood -Rich Moyse -Rich Seymour -Richard Burnison -Richard Hansen -Richard Harvey -Richard Mathie -Richard Metzler -Richard Scothern -Richo Healey -Rick Bradley -Rick van de Loo -Rick Wieman -Rik Nijessen -Riku Voipio -Riley Guerin -Ritesh H Shukla -Riyaz Faizullabhoy -Rob Cowsill <42620235+rcowsill@users.noreply.github.com> -Rob Gulewich -Rob Murray -Rob Vesse -Robert Bachmann -Robert Bittle -Robert Obryk -Robert Schneider -Robert Shade -Robert Stern -Robert Sturla -Robert Terhaar -Robert Wallis -Robert Wang -Roberto G. Hashioka -Roberto Muñoz Fernández -Robin Naundorf -Robin Schneider -Robin Speekenbrink -Robin Thoni -robpc -Rodolfo Carvalho -Rodrigo Campos -Rodrigo Vaz -Roel Van Nyen -Roger Peppe -Rohit Jnagal -Rohit Kadam -Rohit Kapur -Rojin George -Roland Huß -Roland Kammerer -Roland Moriz -Roma Sokolov -Roman Dudin -Roman Mazur -Roman Strashkin -Roman Volosatovs -Roman Zabaluev -Ron Smits -Ron Williams -Rong Gao -Rong Zhang -Rongxiang Song -Rony Weng -root -root -root -root -Rory Hunter -Rory McCune -Ross Boucher -Rovanion Luckey -Roy Reznik -Royce Remer -Rozhnov Alexandr -Rudolph Gottesheim -Rui Cao -Rui JingAn -Rui Lopes -Ruilin Li -Runshen Zhu -Russ Magee -Ryan Abrams -Ryan Anderson -Ryan Aslett -Ryan Barry -Ryan Belgrave -Ryan Campbell -Ryan Detzel -Ryan Fowler -Ryan Liu -Ryan McLaughlin -Ryan O'Donnell -Ryan Seto -Ryan Shea -Ryan Simmen -Ryan Stelly -Ryan Thomas -Ryan Trauntvein -Ryan Wallner -Ryan Zhang -ryancooper7 -RyanDeng -Ryo Nakao -Ryoga Saito -Régis Behmo -Rémy Greinhofer -s. rannou -Sabin Basyal -Sachin Joshi -Sagar Hani -Sainath Grandhi -Sakeven Jiang -Salahuddin Khan -Sally O'Malley -Sam Abed -Sam Alba -Sam Bailey -Sam J Sharpe -Sam Neirinck -Sam Reis -Sam Rijs -Sam Thibault -Sam Whited -Sambuddha Basu -Sami Wagiaalla -Samuel Andaya -Samuel Dion-Girardeau -Samuel Karp -Samuel PHAN -sanchayanghosh -Sandeep Bansal -Sankar சங்கர் -Sanket Saurav -Santhosh Manohar -sapphiredev -Sargun Dhillon -Sascha Andres -Sascha Grunert -SataQiu -Satnam Singh -Satoshi Amemiya -Satoshi Tagomori -Scott Bessler -Scott Collier -Scott Johnston -Scott Moser -Scott Percival -Scott Stamp -Scott Walls -sdreyesg -Sean Christopherson -Sean Cronin -Sean Lee -Sean McIntyre -Sean OMeara -Sean P. Kane -Sean Rodman -Sebastiaan van Steenis -Sebastiaan van Stijn -Sebastian Höffner -Sebastian Radloff -Sebastian Thomschke -Sebastien Goasguen -Senthil Kumar Selvaraj -Senthil Kumaran -SeongJae Park -Seongyeol Lim -Serge Hallyn -Sergey Alekseev -Sergey Evstifeev -Sergii Kabashniuk -Sergio Lopez -Serhat Gülçiçek -Serhii Nakon -SeungUkLee -Sevki Hasirci -Shane Canon -Shane da Silva -Shaun Kaasten -Shaun Thompson -shaunol -Shawn Landden -Shawn Siefkas -shawnhe -Shayan Pooya -Shayne Wang -Shekhar Gulati -Sheng Yang -Shengbo Song -Shengjing Zhu -Shev Yan -Shih-Yuan Lee -Shihao Xia -Shijiang Wei -Shijun Qin -Shishir Mahajan -Shoubhik Bose -Shourya Sarcar -Shreenidhi Shedi -Shu-Wai Chow -shuai-z -Shukui Yang -Sian Lerk Lau -Siarhei Rasiukevich -Sidhartha Mani -sidharthamani -Silas Sewell -Silvan Jegen -Simão Reis -Simon Barendse -Simon Eskildsen -Simon Ferquel -Simon Leinen -Simon Menke -Simon Taranto -Simon Vikstrom -Sindhu S -Sjoerd Langkemper -skanehira -Smark Meng -Solganik Alexander -Solomon Hykes -Song Gao -Soshi Katsuta -Sotiris Salloumis -Soulou -Spencer Brown -Spencer Smith -Spike Curtis -Sridatta Thatipamala -Sridhar Ratnakumar -Srini Brahmaroutu -Srinivasan Srivatsan -Staf Wagemakers -Stanislav Bondarenko -Stanislav Levin -Steeve Morin -Stefan Berger -Stefan Gehrig -Stefan J. Wernli -Stefan Praszalowicz -Stefan S. -Stefan Scherer -Stefan Staudenmeyer -Stefan Weil -Steffen Butzer -Stephan Henningsen -Stephan Spindler -Stephen Benjamin -Stephen Crosby -Stephen Day -Stephen Drake -Stephen Rust -Steve Desmond -Steve Dougherty -Steve Durrheimer -Steve Francia -Steve Koch -Steven Burgess -Steven Erenst -Steven Hartland -Steven Iveson -Steven Merrill -Steven Richards -Steven Taylor -Stéphane Este-Gracias -Stig Larsson -Su Wang -Subhajit Ghosh -Sujith Haridasan -Sun Gengze <690388648@qq.com> -Sun Jianbo -Sune Keller -Sunny Gogoi -Suryakumar Sudar -Sven Dowideit -Swapnil Daingade -Sylvain Baubeau -Sylvain Bellemare -Sébastien -Sébastien HOUZÉ -Sébastien Luttringer -Sébastien Stormacq -Sören Tempel -Tabakhase -Tadej Janež -Tadeusz Dudkiewicz -Takuto Sato -tang0th -Tangi Colin -Tatsuki Sugiura -Tatsushi Inagaki -Taylan Isikdemir -Taylor Jones -tcpdumppy <847462026@qq.com> -Ted M. Young -Tehmasp Chaudhri -Tejaswini Duggaraju -Tejesh Mehta -Terry Chu -terryding77 <550147740@qq.com> -Thatcher Peskens -theadactyl -Thell 'Bo' Fowler -Thermionix -Thiago Alves Silva -Thijs Terlouw -Thomas Bikeev -Thomas Frössman -Thomas Gazagnaire -Thomas Graf -Thomas Grainger -Thomas Hansen -Thomas Ledos -Thomas Leonard -Thomas Léveil -Thomas Orozco -Thomas Riccardi -Thomas Schroeter -Thomas Sjögren -Thomas Swift -Thomas Tanaka -Thomas Texier -Ti Zhou -Tiago Seabra -Tianon Gravi -Tianyi Wang -Tibor Vass -Tiffany Jernigan -Tiffany Low -Till Claassen -Till Wegmüller -Tim -Tim Bart -Tim Bosse -Tim Dettrick -Tim Düsterhus -Tim Hockin -Tim Potter -Tim Ruffles -Tim Smith -Tim Terhorst -Tim Wagner -Tim Wang -Tim Waugh -Tim Wraight -Tim Zju <21651152@zju.edu.cn> -timchenxiaoyu <837829664@qq.com> -timfeirg -Timo Rothenpieler -Timothy Hobbs -tjwebb123 -tobe -Tobias Bieniek -Tobias Bradtke -Tobias Gesellchen -Tobias Klauser -Tobias Munk -Tobias Pfandzelter -Tobias Schmidt -Tobias Schwab -Todd Crane -Todd Lunter -Todd Whiteman -Toli Kuznets -Tom Barlow -Tom Booth -Tom Denham -Tom Fotherby -Tom Howe -Tom Hulihan -Tom Maaswinkel -Tom Parker -Tom Sweeney -Tom Wilkie -Tom X. Tobin -Tom Zhao -Tomas Janousek -Tomas Kral -Tomas Tomecek -Tomasz Kopczynski -Tomasz Lipinski -Tomasz Nurkiewicz -Tomek Mańko -Tommaso Visconti -Tomoya Tabuchi -Tomáš Hrčka -Tomáš Virtus -tonic -Tonny Xu -Tony Abboud -Tony Daws -Tony Miller -toogley -Torstein Husebø -Toshiaki Makita -Tõnis Tiigi -Trace Andreason -tracylihui <793912329@qq.com> -Trapier Marshall -Travis Cline -Travis Thieman -Trent Ogren -Trevor -Trevor Pounds -Trevor Sullivan -Trishna Guha -Tristan Carel -Troy Denton -Tudor Brindus -Ty Alexander -Tycho Andersen -Tyler Brock -Tyler Brown -Tzu-Jung Lee -uhayate -Ulysse Carion -Umesh Yadav -Utz Bacher -vagrant -Vaidas Jablonskis -Valentin Kulesh -vanderliang -Velko Ivanov -Veres Lajos -Victor Algaze -Victor Coisne -Victor Costan -Victor I. Wood -Victor Lyuboslavsky -Victor Marmol -Victor Palma -Victor Toni -Victor Vieux -Victoria Bialas -Vijaya Kumar K -Vikas Choudhary -Vikram bir Singh -Viktor Stanchev -Viktor Vojnovski -VinayRaghavanKS -Vincent Batts -Vincent Bernat -Vincent Boulineau -Vincent Demeester -Vincent Giersch -Vincent Mayers -Vincent Woo -Vinod Kulkarni -Vishal Doshi -Vishnu Kannan -Vitaly Ostrosablin -Vitor Anjos -Vitor Monteiro -Vivek Agarwal -Vivek Dasgupta -Vivek Goyal -Vladimir Bulyga -Vladimir Kirillov -Vladimir Pouzanov -Vladimir Rutsky -Vladimir Varankin -VladimirAus -Vladislav Kolesnikov -Vlastimil Zeman -Vojtech Vitek (V-Teq) -voloder <110066198+voloder@users.noreply.github.com> -Walter Leibbrandt -Walter Stanish -Wang Chao -Wang Guoliang -Wang Jie -Wang Long -Wang Ping -Wang Xing -Wang Yuexiao -Wang Yumu <37442693@qq.com> -wanghuaiqing -Ward Vandewege -WarheadsSE -Wassim Dhif -Wataru Ishida -Wayne Chang -Wayne Song -weebney -Weerasak Chongnguluam -Wei Fu -Wei Wu -Wei-Ting Kuo -weipeng -weiyan -Weiyang Zhu -Wen Cheng Ma -Wendel Fleming -Wenjun Tang -Wenkai Yin -wenlxie -Wenxuan Zhao -Wenyu You <21551128@zju.edu.cn> -Wenzhi Liang -Wes Morgan -Wesley Pettit -Wewang Xiaorenfine -Wiktor Kwapisiewicz -Will Dietz -Will Rouesnel -Will Weaver -willhf -William Delanoue -William Henry -William Hubbs -William Martin -William Riancho -William Thurston -Wilson Júnior -Wing-Kam Wong -WiseTrem -Wolfgang Nagele -Wolfgang Powisch -Wonjun Kim -WuLonghui -xamyzhao -Xia Wu -Xian Chaobo -Xianglin Gao -Xianjie -Xianlu Bird -Xiao YongBiao -Xiao Zhang -XiaoBing Jiang -Xiaodong Liu -Xiaodong Zhang -Xiaohua Ding -Xiaoxi He -Xiaoxu Chen -Xiaoyu Zhang -xichengliudui <1693291525@qq.com> -xiekeyang -Ximo Guanter Gonzálbez -xin.li -Xinbo Weng -Xinfeng Liu -Xinzi Zhou -Xiuming Chen -Xuecong Liao -xuzhaokui -Yadnyawalkya Tale -Yahya -yalpul -YAMADA Tsuyoshi -Yamasaki Masahide -Yamazaki Masashi -Yan Feng -Yan Zhu -Yang Bai -Yang Li -Yang Pengfei -yangchenliang -Yann Autissier -Yanqiang Miao -Yao Zaiyong -Yash Murty -Yassine Tijani -Yasunori Mahata -Yazhong Liu -Yestin Sun -Yi EungJun -Yibai Zhang -Yihang Ho -Ying Li -Yohei Ueda -Yong Tang -Yongxin Li -Yongzhi Pan -Yosef Fertel -You-Sheng Yang (楊有勝) -youcai -Youcef YEKHLEF -Youfu Zhang -YR Chen -Yu Changchun -Yu Chengxia -Yu Peng -Yu-Ju Hong -Yuan Sun -Yuanhong Peng -Yue Zhang -Yufei Xiong -Yuhao Fang -Yuichiro Kaneko -YujiOshima -Yunxiang Huang -Yurii Rashkovskii -Yusuf Tarık Günaydın -Yves Blusseau <90z7oey02@sneakemail.com> -Yves Junqueira -Zac Dover -Zach Borboa -Zach Gershman -Zachary Jaffee -Zain Memon -Zaiste! -Zane DeGraffenried -Zefan Li -Zen Lin(Zhinan Lin) -Zhang Kun -Zhang Wei -Zhang Wentao -zhangguanzhang -ZhangHang -zhangxianwei -Zhenan Ye <21551168@zju.edu.cn> -zhenghenghuo -Zhenhai Gao -Zhenkun Bi -ZhiPeng Lu -zhipengzuo -Zhou Hao -Zhoulin Xie -Zhu Guihua -Zhu Kunjia -Zhuoyun Wei -Ziheng Liu -Zilin Du -zimbatm -Ziming Dong -ZJUshuaizhou <21551191@zju.edu.cn> -zmarouf -Zoltan Tombol -Zou Yu -zqh -Zuhayr Elahi -Zunayed Ali -Álvaro Lázaro -Átila Camurça Alves -吴小白 <296015668@qq.com> -尹吉峰 -屈骏 -徐俊杰 -慕陶 -搏通 -黄艳红00139573 -정재영 diff --git a/vendor/github.com/docker/docker/LICENSE b/vendor/github.com/docker/docker/LICENSE deleted file mode 100644 index 6d8d58fb676b..000000000000 --- a/vendor/github.com/docker/docker/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2013-2018 Docker, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/docker/docker/NOTICE b/vendor/github.com/docker/docker/NOTICE deleted file mode 100644 index 58b19b6d15b9..000000000000 --- a/vendor/github.com/docker/docker/NOTICE +++ /dev/null @@ -1,19 +0,0 @@ -Docker -Copyright 2012-2017 Docker, Inc. - -This product includes software developed at Docker, Inc. (https://www.docker.com). - -This product contains software (https://github.com/creack/pty) developed -by Keith Rarick, licensed under the MIT License. - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see https://www.bis.doc.gov - -See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/github.com/docker/docker/libnetwork/resolvconf/resolvconf.go b/vendor/github.com/docker/docker/libnetwork/resolvconf/resolvconf.go deleted file mode 100644 index 3be2bff6caa6..000000000000 --- a/vendor/github.com/docker/docker/libnetwork/resolvconf/resolvconf.go +++ /dev/null @@ -1,158 +0,0 @@ -// Package resolvconf provides utility code to query and update DNS configuration in /etc/resolv.conf -package resolvconf - -import ( - "bytes" - "net/netip" - "os" - - "github.com/docker/docker/libnetwork/internal/resolvconf" - "github.com/opencontainers/go-digest" -) - -// constants for the IP address type -const ( - IP = iota // IPv4 and IPv6 - IPv4 - IPv6 -) - -// File contains the resolv.conf content and its hash -type File struct { - Content []byte - Hash []byte -} - -func Path() string { - return resolvconf.Path() -} - -// Get returns the contents of /etc/resolv.conf and its hash -func Get() (*File, error) { - return GetSpecific(Path()) -} - -// GetSpecific returns the contents of the user specified resolv.conf file and its hash -func GetSpecific(path string) (*File, error) { - resolv, err := os.ReadFile(path) - if err != nil { - return nil, err - } - hash := digest.FromBytes(resolv) - return &File{Content: resolv, Hash: []byte(hash)}, nil -} - -// FilterResolvDNS cleans up the config in resolvConf. It has two main jobs: -// 1. It looks for localhost (127.*|::1) entries in the provided -// resolv.conf, removing local nameserver entries, and, if the resulting -// cleaned config has no defined nameservers left, adds default DNS entries -// 2. Given the caller provides the enable/disable state of IPv6, the filter -// code will remove all IPv6 nameservers if it is not enabled for containers -func FilterResolvDNS(resolvConf []byte, ipv6Enabled bool) (*File, error) { - rc, err := resolvconf.Parse(bytes.NewBuffer(resolvConf), "") - if err != nil { - return nil, err - } - rc.TransformForLegacyNw(ipv6Enabled) - content, err := rc.Generate(false) - if err != nil { - return nil, err - } - hash := digest.FromBytes(content) - return &File{Content: content, Hash: []byte(hash)}, nil -} - -// GetNameservers returns nameservers (if any) listed in /etc/resolv.conf -func GetNameservers(resolvConf []byte, kind int) []string { - rc, err := resolvconf.Parse(bytes.NewBuffer(resolvConf), "") - if err != nil { - return nil - } - nsAddrs := rc.NameServers() - var nameservers []string - for _, addr := range nsAddrs { - if kind == IP { - nameservers = append(nameservers, addr.String()) - } else if kind == IPv4 && addr.Is4() { - nameservers = append(nameservers, addr.String()) - } else if kind == IPv6 && addr.Is6() { - nameservers = append(nameservers, addr.String()) - } - } - return nameservers -} - -// GetNameserversAsPrefix returns nameservers (if any) listed in -// /etc/resolv.conf as CIDR blocks (e.g., "1.2.3.4/32") -func GetNameserversAsPrefix(resolvConf []byte) []netip.Prefix { - rc, err := resolvconf.Parse(bytes.NewBuffer(resolvConf), "") - if err != nil { - return nil - } - nsAddrs := rc.NameServers() - nameservers := make([]netip.Prefix, 0, len(nsAddrs)) - for _, addr := range nsAddrs { - nameservers = append(nameservers, netip.PrefixFrom(addr, addr.BitLen())) - } - return nameservers -} - -// GetSearchDomains returns search domains (if any) listed in /etc/resolv.conf -// If more than one search line is encountered, only the contents of the last -// one is returned. -func GetSearchDomains(resolvConf []byte) []string { - rc, err := resolvconf.Parse(bytes.NewBuffer(resolvConf), "") - if err != nil { - return nil - } - return rc.Search() -} - -// GetOptions returns options (if any) listed in /etc/resolv.conf -// If more than one options line is encountered, only the contents of the last -// one is returned. -func GetOptions(resolvConf []byte) []string { - rc, err := resolvconf.Parse(bytes.NewBuffer(resolvConf), "") - if err != nil { - return nil - } - return rc.Options() -} - -// Build generates and writes a configuration file to path containing a nameserver -// entry for every element in nameservers, a "search" entry for every element in -// dnsSearch, and an "options" entry for every element in dnsOptions. It returns -// a File containing the generated content and its (sha256) hash. -// -// Note that the resolv.conf file is written, but the hash file is not. -func Build(path string, nameservers, dnsSearch, dnsOptions []string) (*File, error) { - var ns []netip.Addr - for _, addr := range nameservers { - ipAddr, err := netip.ParseAddr(addr) - if err != nil { - return nil, err - } - ns = append(ns, ipAddr) - } - rc := resolvconf.ResolvConf{} - rc.OverrideNameServers(ns) - rc.OverrideSearch(dnsSearch) - rc.OverrideOptions(dnsOptions) - - content, err := rc.Generate(false) - if err != nil { - return nil, err - } - - // Write the resolv.conf file - it's bind-mounted into the container, so can't - // move a temp file into place, just have to truncate and write it. - // - // TODO(thaJeztah): the Build function is currently only used by BuildKit, which only uses "File.Content", and doesn't require the file to be written. - if err := os.WriteFile(path, content, 0o644); err != nil { - return nil, err - } - - // TODO(thaJeztah): the Build function is currently only used by BuildKit, which does not use the Hash - hash := digest.FromBytes(content) - return &File{Content: content, Hash: []byte(hash)}, nil -} diff --git a/vendor/github.com/moby/sys/atomicwriter/LICENSE b/vendor/github.com/moby/profiles/seccomp/LICENSE similarity index 100% rename from vendor/github.com/moby/sys/atomicwriter/LICENSE rename to vendor/github.com/moby/profiles/seccomp/LICENSE diff --git a/vendor/github.com/docker/docker/profiles/seccomp/default.json b/vendor/github.com/moby/profiles/seccomp/default.json similarity index 100% rename from vendor/github.com/docker/docker/profiles/seccomp/default.json rename to vendor/github.com/moby/profiles/seccomp/default.json diff --git a/vendor/github.com/docker/docker/profiles/seccomp/default_linux.go b/vendor/github.com/moby/profiles/seccomp/default_linux.go similarity index 100% rename from vendor/github.com/docker/docker/profiles/seccomp/default_linux.go rename to vendor/github.com/moby/profiles/seccomp/default_linux.go diff --git a/vendor/github.com/docker/docker/profiles/seccomp/kernel_linux.go b/vendor/github.com/moby/profiles/seccomp/kernel_linux.go similarity index 100% rename from vendor/github.com/docker/docker/profiles/seccomp/kernel_linux.go rename to vendor/github.com/moby/profiles/seccomp/kernel_linux.go diff --git a/vendor/github.com/docker/docker/profiles/seccomp/seccomp.go b/vendor/github.com/moby/profiles/seccomp/seccomp.go similarity index 100% rename from vendor/github.com/docker/docker/profiles/seccomp/seccomp.go rename to vendor/github.com/moby/profiles/seccomp/seccomp.go diff --git a/vendor/github.com/docker/docker/profiles/seccomp/seccomp_linux.go b/vendor/github.com/moby/profiles/seccomp/seccomp_linux.go similarity index 100% rename from vendor/github.com/docker/docker/profiles/seccomp/seccomp_linux.go rename to vendor/github.com/moby/profiles/seccomp/seccomp_linux.go diff --git a/vendor/github.com/moby/sys/atomicwriter/atomicwriter.go b/vendor/github.com/moby/sys/atomicwriter/atomicwriter.go deleted file mode 100644 index d0d3be88e124..000000000000 --- a/vendor/github.com/moby/sys/atomicwriter/atomicwriter.go +++ /dev/null @@ -1,245 +0,0 @@ -// Package atomicwriter provides utilities to perform atomic writes to a -// file or set of files. -package atomicwriter - -import ( - "errors" - "fmt" - "io" - "os" - "path/filepath" - "syscall" - - "github.com/moby/sys/sequential" -) - -func validateDestination(fileName string) error { - if fileName == "" { - return errors.New("file name is empty") - } - if dir := filepath.Dir(fileName); dir != "" && dir != "." && dir != ".." { - di, err := os.Stat(dir) - if err != nil { - return fmt.Errorf("invalid output path: %w", err) - } - if !di.IsDir() { - return fmt.Errorf("invalid output path: %w", &os.PathError{Op: "stat", Path: dir, Err: syscall.ENOTDIR}) - } - } - - // Deliberately using Lstat here to match the behavior of [os.Rename], - // which is used when completing the write and does not resolve symlinks. - fi, err := os.Lstat(fileName) - if err != nil { - if os.IsNotExist(err) { - return nil - } - return fmt.Errorf("failed to stat output path: %w", err) - } - - switch mode := fi.Mode(); { - case mode.IsRegular(): - return nil // Regular file - case mode&os.ModeDir != 0: - return errors.New("cannot write to a directory") - case mode&os.ModeSymlink != 0: - return errors.New("cannot write to a symbolic link directly") - case mode&os.ModeNamedPipe != 0: - return errors.New("cannot write to a named pipe (FIFO)") - case mode&os.ModeSocket != 0: - return errors.New("cannot write to a socket") - case mode&os.ModeDevice != 0: - if mode&os.ModeCharDevice != 0 { - return errors.New("cannot write to a character device file") - } - return errors.New("cannot write to a block device file") - case mode&os.ModeSetuid != 0: - return errors.New("cannot write to a setuid file") - case mode&os.ModeSetgid != 0: - return errors.New("cannot write to a setgid file") - case mode&os.ModeSticky != 0: - return errors.New("cannot write to a sticky bit file") - default: - return fmt.Errorf("unknown file mode: %[1]s (%#[1]o)", mode) - } -} - -// New returns a WriteCloser so that writing to it writes to a -// temporary file and closing it atomically changes the temporary file to -// destination path. Writing and closing concurrently is not allowed. -// NOTE: umask is not considered for the file's permissions. -// -// New uses [sequential.CreateTemp] to use sequential file access on Windows, -// avoiding depleting the standby list un-necessarily. On Linux, this equates to -// a regular [os.CreateTemp]. Refer to the [Win32 API documentation] for details -// on sequential file access. -// -// [Win32 API documentation]: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#FILE_FLAG_SEQUENTIAL_SCAN -func New(filename string, perm os.FileMode) (io.WriteCloser, error) { - if err := validateDestination(filename); err != nil { - return nil, err - } - abspath, err := filepath.Abs(filename) - if err != nil { - return nil, err - } - - f, err := sequential.CreateTemp(filepath.Dir(abspath), ".tmp-"+filepath.Base(filename)) - if err != nil { - return nil, err - } - return &atomicFileWriter{ - f: f, - fn: abspath, - perm: perm, - }, nil -} - -// WriteFile atomically writes data to a file named by filename and with the -// specified permission bits. The given filename is created if it does not exist, -// but the destination directory must exist. It can be used as a drop-in replacement -// for [os.WriteFile], but currently does not allow the destination path to be -// a symlink. WriteFile is implemented using [New] for its implementation. -// -// NOTE: umask is not considered for the file's permissions. -func WriteFile(filename string, data []byte, perm os.FileMode) error { - f, err := New(filename, perm) - if err != nil { - return err - } - n, err := f.Write(data) - if err == nil && n < len(data) { - err = io.ErrShortWrite - f.(*atomicFileWriter).writeErr = err - } - if err1 := f.Close(); err == nil { - err = err1 - } - return err -} - -type atomicFileWriter struct { - f *os.File - fn string - writeErr error - written bool - perm os.FileMode -} - -func (w *atomicFileWriter) Write(dt []byte) (int, error) { - w.written = true - n, err := w.f.Write(dt) - if err != nil { - w.writeErr = err - } - return n, err -} - -func (w *atomicFileWriter) Close() (retErr error) { - defer func() { - if err := os.Remove(w.f.Name()); !errors.Is(err, os.ErrNotExist) && retErr == nil { - retErr = err - } - }() - if err := w.f.Sync(); err != nil { - _ = w.f.Close() - return err - } - if err := w.f.Close(); err != nil { - return err - } - if err := os.Chmod(w.f.Name(), w.perm); err != nil { - return err - } - if w.writeErr == nil && w.written { - return os.Rename(w.f.Name(), w.fn) - } - return nil -} - -// WriteSet is used to atomically write a set -// of files and ensure they are visible at the same time. -// Must be committed to a new directory. -type WriteSet struct { - root string -} - -// NewWriteSet creates a new atomic write set to -// atomically create a set of files. The given directory -// is used as the base directory for storing files before -// commit. If no temporary directory is given the system -// default is used. -func NewWriteSet(tmpDir string) (*WriteSet, error) { - td, err := os.MkdirTemp(tmpDir, "write-set-") - if err != nil { - return nil, err - } - - return &WriteSet{ - root: td, - }, nil -} - -// WriteFile writes a file to the set, guaranteeing the file -// has been synced. -func (ws *WriteSet) WriteFile(filename string, data []byte, perm os.FileMode) error { - f, err := ws.FileWriter(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) - if err != nil { - return err - } - n, err := f.Write(data) - if err == nil && n < len(data) { - err = io.ErrShortWrite - } - if err1 := f.Close(); err == nil { - err = err1 - } - return err -} - -type syncFileCloser struct { - *os.File -} - -func (w syncFileCloser) Close() error { - err := w.File.Sync() - if err1 := w.File.Close(); err == nil { - err = err1 - } - return err -} - -// FileWriter opens a file writer inside the set. The file -// should be synced and closed before calling commit. -// -// FileWriter uses [sequential.OpenFile] to use sequential file access on Windows, -// avoiding depleting the standby list un-necessarily. On Linux, this equates to -// a regular [os.OpenFile]. Refer to the [Win32 API documentation] for details -// on sequential file access. -// -// [Win32 API documentation]: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#FILE_FLAG_SEQUENTIAL_SCAN -func (ws *WriteSet) FileWriter(name string, flag int, perm os.FileMode) (io.WriteCloser, error) { - f, err := sequential.OpenFile(filepath.Join(ws.root, name), flag, perm) - if err != nil { - return nil, err - } - return syncFileCloser{f}, nil -} - -// Cancel cancels the set and removes all temporary data -// created in the set. -func (ws *WriteSet) Cancel() error { - return os.RemoveAll(ws.root) -} - -// Commit moves all created files to the target directory. The -// target directory must not exist and the parent of the target -// directory must exist. -func (ws *WriteSet) Commit(target string) error { - return os.Rename(ws.root, target) -} - -// String returns the location the set is writing to. -func (ws *WriteSet) String() string { - return ws.root -} diff --git a/vendor/modules.txt b/vendor/modules.txt index b4ecf0a72ab6..b2e0bf526f6f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -488,9 +488,6 @@ github.com/docker/cli/cli/config/types github.com/docker/cli/cli/connhelper/commandconn # github.com/docker/docker v28.2.2+incompatible ## explicit -github.com/docker/docker/libnetwork/internal/resolvconf -github.com/docker/docker/libnetwork/resolvconf -github.com/docker/docker/profiles/seccomp # github.com/docker/docker-credential-helpers v0.9.3 ## explicit; go 1.21 github.com/docker/docker-credential-helpers/client @@ -631,9 +628,9 @@ github.com/moby/locker ## explicit; go 1.19 github.com/moby/patternmatcher github.com/moby/patternmatcher/ignorefile -# github.com/moby/sys/atomicwriter v0.1.0 -## explicit; go 1.18 -github.com/moby/sys/atomicwriter +# github.com/moby/profiles/seccomp v0.1.0 +## explicit; go 1.23.0 +github.com/moby/profiles/seccomp # github.com/moby/sys/mount v0.3.4 ## explicit; go 1.17 github.com/moby/sys/mount