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
2eb775e2
Commit
2eb775e2
authored
Apr 28, 2018
by
andyzhangx
Committed by
Pengfei Ni
Jun 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove format operation in WaitForAttach
parent
1a1c0bab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
49 deletions
+0
-49
attacher.go
pkg/volume/azure_dd/attacher.go
+0
-4
azure_common_linux.go
pkg/volume/azure_dd/azure_common_linux.go
+0
-42
azure_common_unsupported.go
pkg/volume/azure_dd/azure_common_unsupported.go
+0
-3
No files found.
pkg/volume/azure_dd/attacher.go
View file @
2eb775e2
...
...
@@ -185,10 +185,6 @@ func (a *azureDiskAttacher) WaitForAttach(spec *volume.Spec, devicePath string,
// did we find it?
if
newDevicePath
!=
""
{
// the current sequence k8s uses for unformated disk (check-disk, mount, fail, mkfs.extX) hangs on
// Azure Managed disk scsi interface. this is a hack and will be replaced once we identify and solve
// the root case on Azure.
formatIfNotFormatted
(
newDevicePath
,
*
volumeSource
.
FSType
,
exec
)
return
true
,
nil
}
...
...
pkg/volume/azure_dd/azure_common_linux.go
View file @
2eb775e2
...
...
@@ -178,45 +178,3 @@ func findDiskByLunWithConstraint(lun int, io ioHandler, azureDisks []string) (st
}
return
""
,
err
}
func
formatIfNotFormatted
(
disk
string
,
fstype
string
,
exec
mount
.
Exec
)
{
notFormatted
,
err
:=
diskLooksUnformatted
(
disk
,
exec
)
if
err
==
nil
&&
notFormatted
{
args
:=
[]
string
{
disk
}
// Disk is unformatted so format it.
// Use 'ext4' as the default
if
len
(
fstype
)
==
0
{
fstype
=
"ext4"
}
if
fstype
==
"ext4"
||
fstype
==
"ext3"
{
args
=
[]
string
{
"-E"
,
"lazy_itable_init=0,lazy_journal_init=0"
,
"-F"
,
disk
}
}
glog
.
Infof
(
"azureDisk - Disk %q appears to be unformatted, attempting to format as type: %q with options: %v"
,
disk
,
fstype
,
args
)
_
,
err
:=
exec
.
Run
(
"mkfs."
+
fstype
,
args
...
)
if
err
==
nil
{
// the disk has been formatted successfully try to mount it again.
glog
.
Infof
(
"azureDisk - Disk successfully formatted with 'mkfs.%s %v'"
,
fstype
,
args
)
}
else
{
glog
.
Warningf
(
"azureDisk - Error formatting volume with 'mkfs.%s %v': %v"
,
fstype
,
args
,
err
)
}
}
else
{
if
err
!=
nil
{
glog
.
Warningf
(
"azureDisk - Failed to check if the disk %s formatted with error %s, will attach anyway"
,
disk
,
err
)
}
else
{
glog
.
Infof
(
"azureDisk - Disk %s already formatted, will not format"
,
disk
)
}
}
}
func
diskLooksUnformatted
(
disk
string
,
exec
mount
.
Exec
)
(
bool
,
error
)
{
args
:=
[]
string
{
"-nd"
,
"-o"
,
"FSTYPE"
,
disk
}
glog
.
V
(
4
)
.
Infof
(
"Attempting to determine if disk %q is formatted using lsblk with args: (%v)"
,
disk
,
args
)
dataOut
,
err
:=
exec
.
Run
(
"lsblk"
,
args
...
)
if
err
!=
nil
{
glog
.
Errorf
(
"Could not determine if disk %q is formatted (%v)"
,
disk
,
err
)
return
false
,
err
}
output
:=
libstrings
.
TrimSpace
(
string
(
dataOut
))
return
output
==
""
,
nil
}
pkg/volume/azure_dd/azure_common_unsupported.go
View file @
2eb775e2
...
...
@@ -26,6 +26,3 @@ func scsiHostRescan(io ioHandler, exec mount.Exec) {
func
findDiskByLun
(
lun
int
,
io
ioHandler
,
exec
mount
.
Exec
)
(
string
,
error
)
{
return
""
,
nil
}
func
formatIfNotFormatted
(
disk
string
,
fstype
string
,
exec
mount
.
Exec
)
{
}
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