-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move hyperkit and none drivers to pkg/drivers, share utils #1941
Conversation
703bf81
to
a194ec5
Compare
Codecov Report
@@ Coverage Diff @@
## master #1941 +/- ##
==========================================
- Coverage 30.38% 30.11% -0.27%
==========================================
Files 76 76
Lines 4687 4722 +35
==========================================
- Hits 1424 1422 -2
- Misses 3084 3120 +36
- Partials 179 180 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this cleanup!
return err | ||
} | ||
defer file.Close() | ||
file.Seek(0, os.SEEK_SET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you happen to know if we actually need this call? It never made sense to me that we would.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its in case the file already exists and has contents. The magic boot2docker header that we write in the next lines needs to be the first bytes
pkg/drivers/drivers.go
Outdated
if _, err := file.Write(tarBuf.Bytes()); err != nil { | ||
return err | ||
} | ||
file.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
pkg/drivers/drivers.go
Outdated
if err := createRawDiskImage(publicSSHKeyPath(d), diskPath, diskSize); err != nil { | ||
return err | ||
} | ||
if shouldFixPermissions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a problem with fixing permissions everytime? It should be a no-op I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let me try that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
pkg/drivers/drivers.go
Outdated
files, _ := ioutil.ReadDir(path) | ||
for _, f := range files { | ||
fp := filepath.Join(path, f.Name()) | ||
log.Debugf(fp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some context to this log or delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted
df1ebd6
to
0807686
Compare
Share most of the disk image setup between hyperkit and kvm drivers. Move and remove a lot of shared configuration between all the in-tree drivers: kvm, hyperkit, none.
0807686
to
ebbc34d
Compare
Move hyperkit and none drivers to pkg/drivers, share utils
Share most of the disk image setup between hyperkit and kvm drivers.
Move and remove a lot of shared configuration between all the in-tree
drivers: kvm, hyperkit, none.