Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

allow incluster to accept pass-in config - #193

Merged
k8s-ci-robot merged 1 commit into
kubernetes-client:masterfrom
zshihang:master
May 13, 2020
Merged

allow incluster to accept pass-in config#193
k8s-ci-robot merged 1 commit into
kubernetes-client:masterfrom
zshihang:master

Conversation

@zshihang

Copy link
Copy Markdown
Contributor

fixes the e2e tests in kubernetes-client/python/pull/1161.

in_cluster_config with refreshing is mutating the global Configuration class. since all the tests are running in a single process, e2e tests running after the unit tests will use a modified Configuration.

@k8s-ci-robotk8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 12, 2020
@zshihang

Copy link
Copy Markdown
ContributorAuthor

/assign roycaihw

@codecov-io

codecov-io commented May 12, 2020

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@bf5c599). Click here to learn what that means.
The diff coverage is 95.83%.

Impacted file tree graph

@@ Coverage Diff @@## master #193 +/- ##
=========================================
Coverage ? 92.69% =========================================
Files ? 13 Lines ? 1519 Branches ? 0 =========================================
Hits ? 1408 Misses ? 111 Partials ? 0 
Impacted FilesCoverage Δ
config/incluster_config.py95.45% <93.54%> (ø)
config/incluster_config_test.py97.84% <100.00%> (ø)
config/kube_config_test.py95.59% <0.00%> (ø)
config/exec_provider.py82.60% <0.00%> (ø)
config/__init__.py100.00% <0.00%> (ø)
config/dateutil_test.py100.00% <0.00%> (ø)
config/exec_provider_test.py98.38% <0.00%> (ø)
config/dateutil.py97.91% <0.00%> (ø)
... and 5 more

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 bf5c599...0b1ac80. Read the comment docs.

@k8s-ci-robotk8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 12, 2020
@zshihang

Copy link
Copy Markdown
ContributorAuthor

Comment threadconfig/incluster_config.py Outdated
def __init__(self,
token_filename,
cert_filename,
try_refresh_token,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a breaking change. Please add a default value

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadconfig/incluster_config.py Outdated
self._token_refresh_period = datetime.timedelta(minutes=1)

def load_and_set(self, refresh_token=True):
def load_and_set(self, client_configuration):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we add a separate method and keep the existing one backwards-compatible?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

added default value

Comment threadconfig/incluster_config.py Outdated
def load_and_set(self, client_configuration=None):
try_set_default = False
if client_configuration is None:
config = type.__call__(Configuration)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/config/client_configuration?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

good catch

@roycaihw

Copy link
Copy Markdown
Member

/lgtm
/approve

@k8s-ci-robotk8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 13, 2020
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roycaihw, zshihang

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

The pull request process is described here

Details 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-robotk8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2020
@k8s-ci-robot
k8s-ci-robot merged commit 49ec060 into kubernetes-client:masterMay 13, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approvedIndicates a PR has been approved by an approver from all required OWNERS files.cncf-cla: yesIndicates the PR's author has signed the CNCF CLA.lgtmIndicates that a PR is ready to be merged.size/LDenotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@zshihang@codecov-io@roycaihw@k8s-ci-robot