MCPcopy
hub / github.com/kubeedge/kubeedge / GetOSInterface

Function GetOSInterface

keadm/cmd/keadm/app/cmd/util/common.go:128–140  ·  view source on GitHub ↗

GetOSInterface helps in returning OS specific object which implements OSTypeInstaller interface.

()

Source from the content-addressed store, hash-verified

126
127// GetOSInterface helps in returning OS specific object which implements OSTypeInstaller interface.
128func GetOSInterface() types.OSTypeInstaller {
129 switch GetPackageManager() {
130 case APT:
131 return &DebOS{}
132 case YUM:
133 return &RpmOS{}
134 case PACMAN:
135 return &PacmanOS{}
136 default:
137 fmt.Println("Failed to detect supported package manager command(apt, yum, pacman), exit")
138 panic("Failed to detect supported package manager command(apt, yum, pacman), exit")
139 }
140}
141
142// RunningModule identifies cloudcore/edgecore running or not.
143func RunningModule() (types.ModuleRunning, error) {

Callers 15

DiagnoseNodeFunction · 0.92
InstallToolsMethod · 0.92
NewCloudCoreHelmToolFunction · 0.92
TestNewCloudCoreHelmToolFunction · 0.92
InstallToolsMethod · 0.85
TestGetOSInterfaceFunction · 0.85
RunningModuleFunction · 0.85

Calls 1

GetPackageManagerFunction · 0.85

Tested by 8

TestNewCloudCoreHelmToolFunction · 0.74
TestGetOSInterfaceFunction · 0.68
TestGetOSInterfaceOthersFunction · 0.68