mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
cleanup: remove unused host cache
Signed-off-by: 24sama <jacksama@foxmail.com>
This commit is contained in:
parent
7b0ce709f2
commit
ee24ae51bd
|
|
@ -18,5 +18,4 @@ package os
|
|||
|
||||
const (
|
||||
Release = "release"
|
||||
PkgTool = "pkgTool"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -232,21 +232,9 @@ func (g *GetOSData) Execute(runtime connector.Runtime) error {
|
|||
}
|
||||
osrData := osrelease.Parse(strings.Replace(osReleaseStr, "\r\n", "\n", -1))
|
||||
|
||||
pkgToolStr, err := runtime.GetRunner().SudoCmd(
|
||||
"if [ ! -z $(which yum 2>/dev/null) ]; "+
|
||||
"then echo rpm; "+
|
||||
"elif [ ! -z $(which apt 2>/dev/null) ]; "+
|
||||
"then echo deb; "+
|
||||
"fi", false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
host := runtime.RemoteHost()
|
||||
// type: *osrelease.data
|
||||
host.GetCache().Set(Release, osrData)
|
||||
// type: string
|
||||
host.GetCache().Set(PkgTool, pkgToolStr)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue