Skip to content

Fix an issue where clusterClient's temporary kubeconfig files could persist after the application terminates. Add comments for the clusterclient New(...) methods. #390

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

Merged

Conversation

spew
Copy link
Contributor

@spew spew commented Jun 23, 2018

What this PR does / why we need it:
As pointed out by @roberthbailey on PR #384 there are opportunities for clusterclient to persist temporary files even after the application terminates. Namely in error scenarios while creating the clusterclient. This PR addresses those issues.

Special notes for your reviewer:

Release note:

NONE

@kubernetes/kube-deploy-reviewers

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spew

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 23, 2018
@spew spew force-pushed the fix-cluster-client-new-issues branch 2 times, most recently from 1c84ee3 to 538e226 Compare June 23, 2018 12:51
@spew
Copy link
Contributor Author

spew commented Jun 23, 2018

/assign @roberthbailey @k4leung4 @mkjelland

@roberthbailey
Copy link

lgtm (please fix the nit though)

@spew
Copy link
Contributor Author

spew commented Jun 24, 2018

Hi @roberthbailey I don't see any comment on what to change.


func ifErrRemove(pErr *error, path string) {
if *pErr != nil {
err := os.Remove(path)

Choose a reason for hiding this comment

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

nit: should be cuddled:

if err := os.Remove(); err != nil { ... }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

…ersist after the application terminates. Add comments for the clusterclient New(...) methods.
@spew spew force-pushed the fix-cluster-client-new-issues branch from bc481a2 to 856ca7e Compare June 25, 2018 15:07
@k4leung4
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2018
@k8s-ci-robot k8s-ci-robot merged commit 138f08b into kubernetes-sigs:master Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants