Nothing Special   »   [go: up one dir, main page]

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

make more intelligent kubeconfig merge #953

Merged

Conversation

deads2k
Copy link
Contributor
@deads2k deads2k commented Feb 9, 2015

@fabianofranz This is a better way to merge into .kubeconfig files. It looks for existing cluster and auth info stanzas that already specify the same information as we are using. Then it uses that information to avoid creating unnecessary cruft and maps the names to their appropriate values.

@smarterclayton do we want to push the merging logic upstream?

@smarterclayton
Copy link
Contributor

Yeah

----- Original Message -----

@fabianofranz This is a better way to merge into .kubeconfig files. It looks
for existing cluster and auth info stanzas that already specify the same
information as we are using. Then it uses that information to avoid
creating unnecessary cruft and maps the names to their appropriate values.

@smarterclayton do we want to push the merging logic upstream?
You can view, comment on, or merge this pull request online at:

#953

-- Commit Summary --

  • make more intelligent kubeconfig merge

-- File Changes --

M pkg/cmd/experimental/login/login.go (111)
A pkg/cmd/experimental/login/smart_merge.go (142)

-- Patch Links --

https://github.com/openshift/origin/pull/953.patch
https://github.com/openshift/origin/pull/953.diff


Reply to this email directly or view it on GitHub:
#953

glog.Fatalf("%v\n", err)
}
// check to see if we're already signed in. If so, simply make sure that .kubeconfig has that information
if userFullName, err := whoami(clientCfg); err == nil {
Copy link
Member

Choose a reason for hiding this comment

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

I think if the --username flag was provided we may want to make sure we are already signed in with the same username specified by the flag. That would allow users to simply switch between accounts by doing

openshift ex login -u stark
openshift ex login -u targaryen

It's already in my list btw the osc logout command that would also help in that flow.

@fabianofranz
Copy link
Member

@deads2k Very nice PR, thanks.

@fabianofranz
Copy link
Member

[merge]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_openshift3/876/) (Image: devenv-fedora_749)

@openshift-bot
Copy link
Contributor

Evaluated for origin up to 5d660bd

openshift-bot pushed a commit that referenced this pull request Feb 10, 2015
@openshift-bot openshift-bot merged commit 6a273f0 into openshift:master Feb 10, 2015
@deads2k deads2k deleted the deads-smarter-kubeconfig-merge branch February 23, 2015 16:27
enj pushed a commit to enj/origin that referenced this pull request Jan 3, 2018
always install the jenkins sample template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants