redhat-cop / openshift-toolkit

A collection of code samples to help you get started with OpenShift
Apache License 2.0
234 stars 150 forks source link

use the token variable #32

Closed duritong closed 5 years ago

duritong commented 6 years ago

so you can actually pass it as an argument

etsauer commented 6 years ago

@themoosman can you review this?

themoosman commented 6 years ago

This change isn't necessary as lines 29-33 take care of this if a token isn't provided to the script.

if [ "$#" -eq 2 ]; then
  token=$2
else
  token=`oc whoami -t`
fi

@etsauer @duritong

etsauer commented 6 years ago

@themoosman from what I'm seeing, the issue isn't that the token isn't captured, but the token variable isn't actually passed to the API call, and instead it uses $(oc whoami -t) as the value, therefore the token variable is never actually used.

themoosman commented 6 years ago

Correct. This PR would break the ability to pass a token, i.e. a long lived token, from the command line. @etsauer

duritong commented 6 years ago

@themoosman No, this is actually broken now and my PR fixes it, so that, what you describe as a behavior (passing a token), actually works. I don't see what my PR breaks.