Skip to content

Commit

Permalink
cleanup getDefaultMachineUser|Image
Browse files Browse the repository at this point in the history
small refactoring for containers#1603 adn containers#1608 where we no longer have operating
system differences.

Signed-off-by: Brent Baude <[email protected]>
  • Loading branch information
baude committed Aug 11, 2023
1 parent 524b4d5 commit f27b8be
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 35 deletions.
13 changes: 13 additions & 0 deletions pkg/config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,16 @@ func useUserConfigLocations() bool {
// GetRootlessUID == -1 on Windows, so exclude negative range
return unshare.GetRootlessUID() > 0
}

// getDefaultImage returns the default machine image stream
// On Windows this refers to the Fedora major release number
func getDefaultMachineImage() string {
return "testing"
}

// getDefaultMachineUser returns the user to use for rootless podman
// This is only for the apple, hyperv, and qemu implementations.
// WSL's user will be hardcoded in podman to "user"
func getDefaultMachineUser() string {
return "core"
}
11 changes: 0 additions & 11 deletions pkg/config/default_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@ func getDefaultCgroupsMode() string {
return "enabled"
}

// getDefaultMachineImage returns the default machine image stream
// On Linux/Mac, this returns the FCOS stream
func getDefaultMachineImage() string {
return "testing"
}

// getDefaultMachineUser returns the user to use for rootless podman
func getDefaultMachineUser() string {
return "core"
}

// getDefaultProcessLimits returns the nproc for the current process in ulimits format
// Note that nfile sometimes cannot be set to unlimited, and the limit is hardcoded
// to (oldMaxSize) 1048576 (2^20), see: http://stackoverflow.com/a/1213069/1811501
Expand Down
11 changes: 0 additions & 11 deletions pkg/config/default_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ package config

import "os"

// getDefaultMachineImage returns the default machine image stream
// On Linux/Mac, this returns the FCOS stream
func getDefaultMachineImage() string {
return "testing"
}

// getDefaultMachineUser returns the user to use for rootless podman
func getDefaultMachineUser() string {
return "core"
}

// isCgroup2UnifiedMode returns whether we are running in cgroup2 mode.
func isCgroup2UnifiedMode() (isUnified bool, isUnifiedErr error) {
return false, nil
Expand Down
13 changes: 0 additions & 13 deletions pkg/config/default_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@ package config

import "os"

// getDefaultImage returns the default machine image stream
// On Windows this refers to the Fedora major release number
func getDefaultMachineImage() string {
return "testing"
}

// getDefaultMachineUser returns the user to use for rootless podman
// This is only for the hyperv and qemu implementations. WSL's user
// will be hardcoded in podman to "user"
func getDefaultMachineUser() string {
return "core"
}

// isCgroup2UnifiedMode returns whether we are running in cgroup2 mode.
func isCgroup2UnifiedMode() (isUnified bool, isUnifiedErr error) {
return false, nil
Expand Down

0 comments on commit f27b8be

Please sign in to comment.