mirror of https://github.com/kubernetes/kops.git
Various nits
This commit is contained in:
parent
7c84e7d962
commit
bcafdca7da
|
|
@ -68,19 +68,20 @@ func (b *NetworkBuilder) Build(c *fi.ModelBuilderContext) error {
|
|||
}
|
||||
|
||||
if networking.Cilium != nil {
|
||||
// systemd v238 includes the bpffs mount by default; and gives an error "has a bad unit file setting" if we try to mount it again (see mount_point_is_api)
|
||||
var alreadyMounted bool
|
||||
// bpffs magic number
|
||||
magic := uint32(0xCAFE4A11)
|
||||
var fsdata unix.Statfs_t
|
||||
err := unix.Statfs("/sys/fs/bpf", &fsdata)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("error checking for /sys/fs/bpf: %v", err)
|
||||
} else {
|
||||
alreadyMounted = int32(magic) == int32(fsdata.Type)
|
||||
}
|
||||
|
||||
// systemd v238 includes the bpffs mount by default; and gives an error "has a bad unit file setting" if we try to mount it again (see mount_point_is_api)
|
||||
var alreadyMounted bool
|
||||
// bpffs magic number. See https://github.com/torvalds/linux/blob/v4.8/include/uapi/linux/magic.h#L80
|
||||
magic := uint32(0xCAFE4A11)
|
||||
|
||||
alreadyMounted = int32(magic) == int32(fsdata.Type)
|
||||
|
||||
if !alreadyMounted {
|
||||
unit := s(`
|
||||
[Unit]
|
||||
|
|
|
|||
Loading…
Reference in New Issue