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 get-password robust against invalid kubeconfig entries #5454

Merged
merged 1 commit into from
Mar 13, 2015

Conversation

j3ffml
Copy link
Contributor

@j3ffml j3ffml commented Mar 13, 2015

Properly close #5423, by making get-password do the right thing even if kubeconfig is borked.

cc @satnam6502

# is missing.
# Note: we save dot ('.') to $root because the 'with' action overrides it.
# See http://golang.org/pkg/text/template/.
local username='''{{$root := .}}{{with index $root "current-context"}}{{with index $root "contexts" .}}{{with index . "user"}}{{with index $root "users" .}}{{index . "username"}}{{end}}{{end}}{{end}}{{end}}'''
Copy link
Contributor

Choose a reason for hiding this comment

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

Three single quotes ''' does nothing, it's an empty string '' followed by a normal '. Did you need something different here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I forgot I added those; removed now. Was trying to do multiline, but that adds unwanted linebreaks in the output.

@filbranden
Copy link
Contributor

One small nitpick, otherwise looks good.

@filbranden
Copy link
Contributor

Looks good, merging.

filbranden added a commit that referenced this pull request Mar 13, 2015
Make get-password robust against invalid kubeconfig entries
@filbranden filbranden merged commit 0948cb7 into kubernetes:master Mar 13, 2015
@j3ffml j3ffml deleted the get-password branch March 16, 2015 18:19
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.

kube-up.sh failed with template error
3 participants