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

[OSD-20017] create config file with login --multi even if target config file exists #301

Merged
merged 3 commits into from
Jan 4, 2024

Conversation

Tof1973
Copy link
Contributor

@Tof1973 Tof1973 commented Dec 21, 2023

What type of PR is this?

bug

What this PR does / Why we need it?

Without this change, when using login --multi on a cluster where we already did it, but where credentials expired, the connection will not work.

Which Jira/Github issue(s) does this PR fix?

Resolves #OSD-20017

Special notes for your reviewer

Pre-checks (if applicable)

  • [ x] Ran unit tests locally
  • [ x] Validated the changes in a cluster
  • [na ] Included documentation changes with PR

pkg/login/kubeConfig.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (d797914) 45.93% compared to head (8250c2a) 45.89%.
Report is 9 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #301      +/-   ##
==========================================
- Coverage   45.93%   45.89%   -0.05%     
==========================================
  Files          53       53              
  Lines        3753     3785      +32     
==========================================
+ Hits         1724     1737      +13     
- Misses       1754     1775      +21     
+ Partials      275      273       -2     
Files Coverage Δ
pkg/login/kubeConfig.go 61.29% <55.55%> (+1.91%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Member

@typeid typeid left a comment

Choose a reason for hiding this comment

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

Generally lgtm, added one suggestion

pkg/login/kubeConfig.go Outdated Show resolved Hide resolved
@xiaoyu74
Copy link
Contributor

Also, given the changes made to the CreateClusterKubeConfig function that it now overwrites the kubeconfig file each time it is called, rather than only creating it if it doesn't exist, we might need to update test cases accordingly.

Apart from that, LGTM, great work @Tof1973 👍

@bmeng
Copy link
Contributor

bmeng commented Jan 4, 2024

Cannot understand why it has to check the file existence before writing... cc @samanthajayasinghe please let me know if there is a reason
/lgtm
/label tide/merge-method-squash

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jan 4, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 4, 2024
Copy link
Contributor

openshift-ci bot commented Jan 4, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bmeng, Tof1973

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 4, 2024
Copy link
Contributor

openshift-ci bot commented Jan 4, 2024

@Tof1973: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit d24a173 into openshift:main Jan 4, 2024
7 checks passed
@Tof1973 Tof1973 deleted the OSD-20017 branch January 5, 2024 07:43
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. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants