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

revert(linux): DOCKER_CONFIG path (#1102) #1110

Merged
merged 1 commit into from
Sep 23, 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
1 change: 0 additions & 1 deletion cmd/finch/main_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ var newApp = func(
logger,
fp.NerdctlConfigFilePath(),
fp.BuildkitSocketPath(),
fp.DockerConfigDir(),
fp.FinchDependencyBinDir(),
system.NewStdLib(),
)
Expand Down
5 changes: 0 additions & 5 deletions pkg/command/nerdctl_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
const (
EnvKeyNerdctlTOML = "NERDCTL_TOML"
EnvKeyBuildkitHost = "BUILDKIT_HOST"
EnvKeyDockerConfig = "DOCKER_CONFIG"
)

type nerdctlCmdCreator struct {
Expand All @@ -29,7 +28,6 @@ type nerdctlCmdCreator struct {
systemDeps NerdctlCmdCreatorSystemDeps
nerdctlConfigPath string
buildkitSocketPath string
dockerConfigPath string
binPath string
}

Expand All @@ -41,7 +39,6 @@ func NewNerdctlCmdCreator(
logger flog.Logger,
nerdctlConfigPath string,
buildkitSocketPath string,
dockerConfigPath string,
binPath string,
systemDeps NerdctlCmdCreatorSystemDeps,
) NerdctlCmdCreator {
Expand All @@ -50,7 +47,6 @@ func NewNerdctlCmdCreator(
logger: logger,
nerdctlConfigPath: nerdctlConfigPath,
buildkitSocketPath: buildkitSocketPath,
dockerConfigPath: dockerConfigPath,
binPath: binPath,
systemDeps: systemDeps,
}
Expand All @@ -69,7 +65,6 @@ func (ncc *nerdctlCmdCreator) create(stdin io.Reader, stdout, stderr io.Writer,
newPathEnv = append(
newPathEnv,
fmt.Sprintf("%s=%s", EnvKeyNerdctlTOML, ncc.nerdctlConfigPath),
fmt.Sprintf("%s=%s", EnvKeyDockerConfig, ncc.dockerConfigPath),
fmt.Sprintf("%s=unix://%s", EnvKeyBuildkitHost, ncc.buildkitSocketPath),
)

Expand Down
3 changes: 0 additions & 3 deletions pkg/command/nerdctl_native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
const (
mockNerdctlConfigPath = "/etc/finch/nerdctl.toml"
mockBuildkitSocketPath = "/etc/finch/buildkit"
mockDockerConfigPath = "/etc/finch/docker"
mockFinchBinPath = "/usr/lib/usrexec/finch"
mockSystemPath = "/usr/bin"
finalPath = mockFinchBinPath + command.EnvKeyPathJoiner + mockSystemPath
Expand Down Expand Up @@ -48,7 +47,6 @@ func TestLimaCmdCreator_Create(t *testing.T) {
cmd.EXPECT().SetEnv([]string{
fmt.Sprintf("%s=%s", command.EnvKeyPath, finalPath),
fmt.Sprintf("%s=%s", command.EnvKeyNerdctlTOML, mockNerdctlConfigPath),
fmt.Sprintf("%s=%s", command.EnvKeyDockerConfig, mockDockerConfigPath),
fmt.Sprintf("%s=unix://%s", command.EnvKeyBuildkitHost, mockBuildkitSocketPath),
})
cmd.EXPECT().SetStdin(nil)
Expand All @@ -74,7 +72,6 @@ func TestLimaCmdCreator_Create(t *testing.T) {
logger,
mockNerdctlConfigPath,
mockBuildkitSocketPath,
mockDockerConfigPath,
mockFinchBinPath,
lcd,
).Create(mockArgs...)
Expand Down
6 changes: 0 additions & 6 deletions pkg/path/finch_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ func (fp Finch) BuildkitSocketPath() string {
return filepath.Join(fp.FinchRuntimeDataDir(), "buildkit", "buildkitd.sock")
}

// DockerConfigDir returns the path to the docker config file.
// nerdctl uses ${DOCKER_CONFIG}/config.json for authentication with image registries.
func (fp Finch) DockerConfigDir() string {
return filepath.Join(string(fp), "docker")
}

// FinchDependencyBinDir returns the path to Finch's local helper or dependency binaries.
// Currently used for vended version of BuildKit.
func (Finch) FinchDependencyBinDir() string {
Expand Down
Loading