Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Automatically creates the token auth file if it isn't present #439

Merged
merged 2 commits into from
Mar 23, 2017
Merged

Automatically creates the token auth file if it isn't present #439

merged 2 commits into from
Mar 23, 2017

Conversation

danielfm
Copy link
Contributor

@danielfm danielfm commented Mar 23, 2017

This PR improves UX after #418, hopefully avoiding issues like this.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 23, 2017
@codecov-io
Copy link

Codecov Report

Merging #439 into master will increase coverage by 0.04%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #439      +/-   ##
==========================================
+ Coverage   40.75%   40.79%   +0.04%     
==========================================
  Files          37       37              
  Lines        2660     2662       +2     
==========================================
+ Hits         1084     1086       +2     
  Misses       1418     1418              
  Partials      158      158
Impacted Files Coverage Δ
core/controlplane/config/token_config.go 70.53% <100%> (+0.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63f0aba...50b2b2c. Read the comment docs.


// Auto-creates the auth token file, useful for those coming from previous versions of kube-aws
if _, err := os.Stat(authTokenPath); os.IsNotExist(err) {
os.OpenFile(authTokenPath, os.O_RDONLY|os.O_CREATE, 0600)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost nit but wouldn't it be safer to close the opened file afterwards?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, forgot to close it. 😓

@mumoshu just to let you know, feel free not to merge my PRs unless they are 100% according to your standards regarding code style, quality, and so on; just give me your feedback and I'll try to address them ASAP.

@mumoshu
Copy link
Contributor

mumoshu commented Mar 23, 2017

1 nit but LGTM overall 👍
Thanks for your efforts @danielfm!

@mumoshu mumoshu merged commit 73481f6 into kubernetes-retired:master Mar 23, 2017
@mumoshu
Copy link
Contributor

mumoshu commented Mar 23, 2017 via email

@danielfm danielfm deleted the auto-creates-token-file branch March 23, 2017 17:07
kylehodgetts pushed a commit to HotelsDotCom/kube-aws that referenced this pull request Mar 27, 2018
…token-file

Automatically creates the token auth file if it isn't present
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants