-
Notifications
You must be signed in to change notification settings - Fork 170
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
ocp4 admin credentials #62
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,20 @@ environments: | |
admin_creds: MasterOsAdminCredentials | ||
api_port: 8443 | ||
# version: 3.6.1.44.16 | ||
ocp4: | ||
# hosts: use OPENSHIFT_ENV_OSE_HOSTS=host:role1:...,host2:role1:... | ||
hosts_type: SSHAccessibleHost | ||
# this is the user for remote access to the OpenShift nodes | ||
user: core | ||
type: StaticEnvironment | ||
user_manager: auto | ||
# set users in OPENSHIFT_ENV_OSE_USER_MANAGER_USERS=user:password,... | ||
# user_manager_users: joe:redhat,alice:redhat | ||
#cli: MasterOsPerUserCliExecutor | ||
cli: SharedLocalCliExecutor | ||
admin_creds: MasterOsAdminCredentials | ||
api_port: 6443 | ||
version: 4.0.0.0 # version not supported on cluster (yet) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcode There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @xingxingxia , not having access to version anonymously will require some changes. I'd like to make sure we are not getting what we need before implementing something that may not be as nice as present implementation. |
||
|
||
optional_classes: | ||
tcms_tc_manager: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,21 @@ def initialize(env, **opts) | |
|
||
# @return [APIAccessor] | ||
def get | ||
res = master_host.exec_as(:admin, "cat /root/.kube/config", quiet: true) | ||
res = master_host.exec_admin("cat /root/.kube/config", quiet: true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @akostadinov , tried
Env is good because then I turned back to my former workaround as below and that still passes (37495/console):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In console log I see You sure installer created the machine with the correct key? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure correct key, compare below:
I asked other colleague @yanpzhan trying their subteam env and met same error 37496/console There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my cluster it has been working fine. I've never did your workaround - neither with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I managed to reproduce. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @wjiangjay Adding these fix the problem, but I didn't have those settings for 3.x auto tests and they work. Why do we need add them in 4.0? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we change some logic which handle the stderr and stdout There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you all. I added ocp4 explicitly in Runner-v3 param description for ..._DEFAULT_ENVIRONMENT. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wjiangjay , we can change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make sense! |
||
if !res[:success] && res[:response].include?("No such file or directory") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @akostadinov Hmm, today encountered another failure due to non-robust code here:
I debugged on the master: http://pastebin.test.redhat.com/701353 , its /root/.kube/config is just the one shown in the failure log's output, which does not include admin cert/key. The failure cause is somebody did oc login on root@master with normal OCP user, which will create new /root/.kube/config, having no admin. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can make it work with the token from the file but token is temporary and next day it will not work. Not sure it is a good idea. |
||
# try to find kubeconfig in other locations | ||
locations = [["kubeconfig", "/etc/kubernetes/static-pod-resources"]] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heard from @jianlinliu that Dev is in-flight making cluster not ssh-able. So I think we still need URL support for kubeconfig. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unbelievable, how is customer supposed to access cluster if it is not SSH-able? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't read the linked to issue that SSH will be disabled. It makes not sense IMO to disable SSH. |
||
configs = locations.each do |pattern, path| | ||
find = master_host.exec_admin( | ||
"find '#{path}' -name '#{pattern}'", quiet: true) | ||
if find[:success] && !find[:response].empty? | ||
kubeconfig = find[:response].lines.first.strip | ||
res = master_host.exec_admin("cat '#{kubeconfig}'", quiet: true) | ||
break | ||
end | ||
end | ||
end | ||
|
||
if res[:success] | ||
logger.plain res[:response], false | ||
# host_pattern = '(?:' << env.master_hosts.map{|h| Regexp.escape h.hostname).join('|') << ')' | ||
|
@@ -43,7 +57,7 @@ def get | |
) | ||
else | ||
logger.error(res[:response]) | ||
raise "error running command on master #{master_host.hostname} as admin, see log" | ||
raise "error getting kubeconfig from master #{master_host.hostname}, see log" | ||
end | ||
end | ||
end | ||
|
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.
@openshift/team-qe fyi, now using ocp4 as BUSHSLICER_DEFAULT_ENVIRONMENT would let us need not add air_port and version for nextgen auto test