-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Wait for the token to be added to serviceaccount before running command #12582
Conversation
[test] |
@@ -356,6 +356,7 @@ os::cmd::expect_success 'oc whoami' | |||
|
|||
os::log::info "Running a CLI command in a container using the service account" | |||
os::cmd::expect_success 'oc policy add-role-to-user view -z default' | |||
os::cmd::try_until_text 'oc get -n test serviceaccount/default --template="{{.secrets}}"' 'token' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the oc sa gettoken
command instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I didn't know we have something like that, will rework right away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoever added that was a real team player ;)
Hmm... interesting previous version still failed on that |
Evaluated for origin test up to 534adce |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13082/) (Base Commit: 1e269a3) |
Based on IRC approval, we'll dig further when this is in. [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13082/) (Image: devenv-rhel7_5734) |
Evaluated for origin merge up to 534adce |
Apparently between line 358 and 359 it takes a bit longer, sometime to get the token available in the serviceaccount. I'm adding there a small wait time to bypass the problem.
Fixes #12558
@deads2k @ncdc @smarterclayton ptal