Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Linux-isms in code #5271

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions cmd/buildkitd/constants_unix.go

This file was deleted.

5 changes: 0 additions & 5 deletions cmd/buildkitd/constants_windows.go

This file was deleted.

4 changes: 2 additions & 2 deletions cmd/buildkitd/main_containerd_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func init() {
}

if defaultConf.Workers.Containerd.Address == "" {
defaultConf.Workers.Containerd.Address = defaultContainerdAddress
defaultConf.Workers.Containerd.Address = defaults.DefaultAddress
}

if defaultConf.Workers.Containerd.Namespace == "" {
Expand Down Expand Up @@ -178,7 +178,7 @@ func init() {

func applyContainerdFlags(c *cli.Context, cfg *config.Config) error {
if cfg.Workers.Containerd.Address == "" {
cfg.Workers.Containerd.Address = defaultContainerdAddress
cfg.Workers.Containerd.Address = defaults.DefaultAddress
}

if c.GlobalIsSet("containerd-worker") {
Expand Down
2 changes: 1 addition & 1 deletion hack/Vagrantfile.freebsd13
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Vagrant.configure("2") do |config|
#!/usr/bin/env bash
set -eux -o pipefail
mkdir -p /run/buildkit
daemon -o /vagrant/.tmp/logs/buildkitd /usr/local/bin/buildkitd --addr=unix:///run/buildkit/buildkitd.sock
daemon -o /vagrant/.tmp/logs/buildkitd /usr/local/bin/buildkitd
sleep 3
SHELL
end
Expand Down
17 changes: 0 additions & 17 deletions snapshot/diffapply_freebsd.go

This file was deleted.

3 changes: 0 additions & 3 deletions snapshot/diffapply_unix.go → snapshot/diffapply_linux.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build !windows && !freebsd
// +build !windows,!freebsd

package snapshot

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
//go:build windows
// +build windows
//go:build !linux
// +build !linux

package snapshot

import (
"context"
"runtime"

"github.com/containerd/containerd/leases"
"github.com/containerd/containerd/snapshots"
"github.com/pkg/errors"
)

func (sn *mergeSnapshotter) diffApply(_ context.Context, _ Mountable, _ ...Diff) (_ snapshots.Usage, rerr error) {
return snapshots.Usage{}, errors.New("diffApply not yet supported on windows")
return snapshots.Usage{}, errors.New("diffApply not yet supported on " + runtime.GOOS)
}

func needsUserXAttr(_ context.Context, _ Snapshotter, _ leases.Manager) (bool, error) {
return false, errors.New("needs userxattr not supported on windows")
return false, errors.New("needs userxattr not supported on " + runtime.GOOS)
}
3 changes: 0 additions & 3 deletions source/git/source_unix.go → source/git/source_linux.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build !windows && !freebsd
// +build !windows,!freebsd

package git

import (
Expand Down
6 changes: 6 additions & 0 deletions util/appdefaults/appdefaults_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package appdefaults

const (
Address = "unix:///run/buildkit/buildkitd.sock"
traceSocketPath = "/run/buildkit/otel-grpc.sock"
)
3 changes: 1 addition & 2 deletions util/appdefaults/appdefaults_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
)

const (
Address = "unix:///run/buildkit/buildkitd.sock"
Root = "/var/lib/buildkit"
ConfigDir = "/etc/buildkit"
DefaultCNIBinDir = "/opt/cni/bin"
Expand Down Expand Up @@ -82,5 +81,5 @@ func TraceSocketPath(inUserNS bool) string {
return filepath.Join(dirs[0], "buildkit", "otel-grpc.sock")
}
}
return "/run/buildkit/otel-grpc.sock"
return traceSocketPath
}
8 changes: 8 additions & 0 deletions util/appdefaults/appdefaults_unix_nolinux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build unix && !linux

package appdefaults

const (
Address = "unix:///var/run/buildkit/buildkitd.sock"
traceSocketPath = "/var/run/buildkit/otel-grpc.sock"
)
Loading