Skip to content
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

improve kubeconfig file modification time #67093

Conversation

juanvallejo
Copy link
Contributor

@juanvallejo juanvallejo commented Aug 7, 2018

In cases where there are few destination filenames for a given
amount of contexts, but a large amount of contexts, this patch
prevents reading and writing to the same file (or small number
of files) over and over again needlessly.

Release note:

Decrease the amount of time it takes to modify kubeconfig files with large amounts of contexts

cc @deads2k

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 7, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 7, 2018
@neolit123
Copy link
Member

@juanvallejo
possibly needs a release note?

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Aug 7, 2018
@deads2k
Copy link
Contributor

deads2k commented Aug 8, 2018

It looks like this works. Please confirm there is test coverage on this.

Trades runtime complexity for spacial complexity when modifying
large amounts of contexts on a kubeconfig.

In cases where there are few destination filenames for a given
amount of contexts, but a large amount of contexts, this patch
prevents reading and writing to the same file (or small number
of files) over and over again needlessly.
@juanvallejo juanvallejo force-pushed the jvallejo/improve-config-context-update branch from 2c05e89 to d565194 Compare August 8, 2018 20:13
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 8, 2018
@juanvallejo
Copy link
Contributor Author

@deads2k

It looks like this works. Please confirm there is test coverage on this.

Added a test for context modification

@deads2k
Copy link
Contributor

deads2k commented Aug 9, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 9, 2018
@fedebongio
Copy link
Contributor

/assign @yliaog

@yliaog
Copy link
Contributor

yliaog commented Aug 9, 2018

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, juanvallejo, yliaog

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-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 67161, 67093, 67077). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 3587aa4 into kubernetes:master Aug 10, 2018
@juanvallejo juanvallejo deleted the jvallejo/improve-config-context-update branch August 10, 2018 13:26
k8s-github-robot pushed a commit that referenced this pull request Aug 15, 2018
…fig-tests

Automatic merge from submit-queue (batch tested with PRs 67347, 67307, 67358, 67364, 67385). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use temp file for kubeconfig in test

Followup to #67093

Updates client_config_test to use a temporary file for kubeconfig.

**Release note**:
```release-note
NONE
```

cc @deads2k @soltysh
k8s-publishing-bot added a commit to kubernetes/client-go that referenced this pull request Aug 16, 2018
…fig-tests

Automatic merge from submit-queue (batch tested with PRs 67347, 67307, 67358, 67364, 67385). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use temp file for kubeconfig in test

Followup to kubernetes/kubernetes#67093

Updates client_config_test to use a temporary file for kubeconfig.

**Release note**:
```release-note
NONE
```

cc @deads2k @soltysh

Kubernetes-commit: 46bfa1ab17afaffc584f560ee5c752ecbbad4f61
sttts pushed a commit to sttts/client-go that referenced this pull request Sep 5, 2018
…fig-tests

Automatic merge from submit-queue (batch tested with PRs 67347, 67307, 67358, 67364, 67385). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use temp file for kubeconfig in test

Followup to kubernetes/kubernetes#67093

Updates client_config_test to use a temporary file for kubeconfig.

**Release note**:
```release-note
NONE
```

cc @deads2k @soltysh

Kubernetes-commit: 46bfa1ab17afaffc584f560ee5c752ecbbad4f61
k8s-publishing-bot added a commit to kubernetes/client-go that referenced this pull request Sep 6, 2018
…fig-tests

Automatic merge from submit-queue (batch tested with PRs 67347, 67307, 67358, 67364, 67385). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use temp file for kubeconfig in test

Followup to kubernetes/kubernetes#67093

Updates client_config_test to use a temporary file for kubeconfig.

**Release note**:
```release-note
NONE
```

cc @deads2k @soltysh

Kubernetes-commit: 46bfa1ab17afaffc584f560ee5c752ecbbad4f61
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants