Update ingress godeps
This commit is contained in:
parent
d43021b3f1
commit
28db8fb16d
1068 changed files with 461467 additions and 117300 deletions
21
vendor/k8s.io/kubernetes/pkg/util/sysctl/sysctl.go
generated
vendored
21
vendor/k8s.io/kubernetes/pkg/util/sysctl/sysctl.go
generated
vendored
|
|
@ -37,8 +37,25 @@ const (
|
|||
KernelPanicRebootTimeout = 10 // seconds after a panic for the kernel to reboot
|
||||
)
|
||||
|
||||
// An injectable interface for running sysctl commands.
|
||||
type Interface interface {
|
||||
// GetSysctl returns the value for the specified sysctl setting
|
||||
GetSysctl(sysctl string) (int, error)
|
||||
// SetSysctl modifies the specified sysctl flag to the new value
|
||||
SetSysctl(sysctl string, newVal int) error
|
||||
}
|
||||
|
||||
// New returns a new Interface for accessing sysctl
|
||||
func New() Interface {
|
||||
return &procSysctl{}
|
||||
}
|
||||
|
||||
// procSysctl implements Interface by reading and writing files under /proc/sys
|
||||
type procSysctl struct {
|
||||
}
|
||||
|
||||
// GetSysctl returns the value for the specified sysctl setting
|
||||
func GetSysctl(sysctl string) (int, error) {
|
||||
func (_ *procSysctl) GetSysctl(sysctl string) (int, error) {
|
||||
data, err := ioutil.ReadFile(path.Join(sysctlBase, sysctl))
|
||||
if err != nil {
|
||||
return -1, err
|
||||
|
|
@ -51,6 +68,6 @@ func GetSysctl(sysctl string) (int, error) {
|
|||
}
|
||||
|
||||
// SetSysctl modifies the specified sysctl flag to the new value
|
||||
func SetSysctl(sysctl string, newVal int) error {
|
||||
func (_ *procSysctl) SetSysctl(sysctl string, newVal int) error {
|
||||
return ioutil.WriteFile(path.Join(sysctlBase, sysctl), []byte(strconv.Itoa(newVal)), 0640)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue