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

allow incluster to accept pass-in config #193

Merged
merged 1 commit into from
May 13, 2020

Conversation

zshihang
Copy link
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-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 12, 2020
@zshihang
Copy link
Contributor Author

/assign roycaihw

@codecov-io
Copy link

codecov-io commented May 12, 2020

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 Files Coverage Δ
config/incluster_config.py 95.45% <93.54%> (ø)
config/incluster_config_test.py 97.84% <100.00%> (ø)
config/kube_config_test.py 95.59% <0.00%> (ø)
config/exec_provider.py 82.60% <0.00%> (ø)
config/__init__.py 100.00% <0.00%> (ø)
config/dateutil_test.py 100.00% <0.00%> (ø)
config/exec_provider_test.py 98.38% <0.00%> (ø)
config/dateutil.py 97.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-robot k8s-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
Contributor Author

def __init__(self,
token_filename,
cert_filename,
try_refresh_token,
Copy link
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
Contributor Author

Choose a reason for hiding this comment

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

done

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
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
Contributor Author

Choose a reason for hiding this comment

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

added default value

def load_and_set(self, client_configuration=None):
try_set_default = False
if client_configuration is None:
config = type.__call__(Configuration)
Copy link
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
Contributor Author

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
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 13, 2020
@k8s-ci-robot
Copy link
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

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 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:master May 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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 Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants