Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
4629c8a5
Commit
4629c8a5
authored
Sep 04, 2017
by
jianglingxia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
squash the commits into one
parent
0dedd13a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
mount_linux.go
pkg/util/mount/mount_linux.go
+3
-6
No files found.
pkg/util/mount/mount_linux.go
View file @
4629c8a5
...
@@ -42,9 +42,6 @@ const (
...
@@ -42,9 +42,6 @@ const (
procMountsPath
=
"/proc/mounts"
procMountsPath
=
"/proc/mounts"
// Location of the mountinfo file
// Location of the mountinfo file
procMountInfoPath
=
"/proc/self/mountinfo"
procMountInfoPath
=
"/proc/self/mountinfo"
)
const
(
// 'fsck' found errors and corrected them
// 'fsck' found errors and corrected them
fsckErrorsCorrected
=
1
fsckErrorsCorrected
=
1
// 'fsck' found errors but exited without correcting them
// 'fsck' found errors but exited without correcting them
...
@@ -71,12 +68,12 @@ func New(mounterPath string) Interface {
...
@@ -71,12 +68,12 @@ func New(mounterPath string) Interface {
// Mount mounts source to target as fstype with given options. 'source' and 'fstype' must
// Mount mounts source to target as fstype with given options. 'source' and 'fstype' must
// be an emtpy string in case it's not required, e.g. for remount, or for auto filesystem
// be an emtpy string in case it's not required, e.g. for remount, or for auto filesystem
// type, where kernel handles fs
type for you. The mount 'options' is a list of options,
// type, where kernel handles fstype for you. The mount 'options' is a list of options,
// currently come from mount(8), e.g. "ro", "remount", "bind", etc. If no more option is
// currently come from mount(8), e.g. "ro", "remount", "bind", etc. If no more option is
// required, call Mount with an empty string list or nil.
// required, call Mount with an empty string list or nil.
func
(
mounter
*
Mounter
)
Mount
(
source
string
,
target
string
,
fstype
string
,
options
[]
string
)
error
{
func
(
mounter
*
Mounter
)
Mount
(
source
string
,
target
string
,
fstype
string
,
options
[]
string
)
error
{
// Path to mounter binary if containerized mounter is needed. Otherwise, it is set to empty.
// Path to mounter binary if containerized mounter is needed. Otherwise, it is set to empty.
// All Linux distros are expected to be shipped with a mount utility that a
n
support bind mounts.
// All Linux distros are expected to be shipped with a mount utility that a support bind mounts.
mounterPath
:=
""
mounterPath
:=
""
bind
,
bindRemountOpts
:=
isBind
(
options
)
bind
,
bindRemountOpts
:=
isBind
(
options
)
if
bind
{
if
bind
{
...
@@ -449,7 +446,7 @@ func (mounter *SafeFormatAndMount) formatAndMount(source string, target string,
...
@@ -449,7 +446,7 @@ func (mounter *SafeFormatAndMount) formatAndMount(source string, target string,
return
mountErr
return
mountErr
}
}
//
diskLooksUnformatted
uses 'lsblk' to see if the given disk is unformated
//
getDiskFormat
uses 'lsblk' to see if the given disk is unformated
func
(
mounter
*
SafeFormatAndMount
)
getDiskFormat
(
disk
string
)
(
string
,
error
)
{
func
(
mounter
*
SafeFormatAndMount
)
getDiskFormat
(
disk
string
)
(
string
,
error
)
{
args
:=
[]
string
{
"-n"
,
"-o"
,
"FSTYPE"
,
disk
}
args
:=
[]
string
{
"-n"
,
"-o"
,
"FSTYPE"
,
disk
}
glog
.
V
(
4
)
.
Infof
(
"Attempting to determine if disk %q is formatted using lsblk with args: (%v)"
,
disk
,
args
)
glog
.
V
(
4
)
.
Infof
(
"Attempting to determine if disk %q is formatted using lsblk with args: (%v)"
,
disk
,
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment