Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

tests: add master and worker role #3074

Merged
merged 2 commits into from
Mar 21, 2018
Merged

tests: add master and worker role #3074

merged 2 commits into from
Mar 21, 2018

Conversation

cpanato
Copy link
Contributor

@cpanato cpanato commented Mar 6, 2018

fixes: INST-972

@coreosbot
Copy link

Can one of the admins verify this patch?

@cpanato cpanato changed the title [WIP] tests: add master and worker role tests: add master and worker role Mar 21, 2018
@enxebre enxebre merged commit 6b0e79f into coreos:master Mar 21, 2018
@cpanato cpanato deleted the INST-972 branch March 21, 2018 10:05
wking added a commit to wking/openshift-installer that referenced this pull request Aug 24, 2018
I'm not authorized to assume roles in the teamcoreservices account,
and the assume-role call errors out with:

  An error occurred (AccessDenied) when calling the AssumeRole
  operation: Not authorized to perform sts:AssumeRole

That's fine though; I can still launch the cluster with my usual
access.  This commit makes the role assumption optional.  I've made
setting up the AWS_* access variables conditional on successful role
assumption, because setting them based on an empty $RES wouldn't work
;).

Using the && chain with a terminal || keeps the script from dying on
this assume-role failure.  From the 'set -e' docs [1]:

  The shell does not exit if the command that fails is ... part of any
  command executed in a && or || list except the command following the
  final && or ||...

I'm also only setting iamRoleName configs if assume-role succeeded.
We've been setting iamRoleName since the script landed in a2405e4
(run smoke tests with bash script, 2018-06-18,
coreos/tectonic-installer#3284) and possibly before that since
82daae1 (tests: add etcd role, 2018-03-14,
coreos/tectonic-installer#3074).  I don't see anything in those
commits or PRs to motivate the iamRoleName entries, but I'd guess
they, like the tf-tectonic-installer role, are specific to the Jenkins
setup.  I've tied them together with CONFIGURE_AWS_ROLES based on that
similarity, although in theory you may be able to toggle the
iamRoleName settings independently of assume-role success.

Even though the &&/|| chain sets CONFIGURE_AWS_ROLES=False when
assume-role failes, I'm using ${CONFIGURE_AWS_ROLES:-False} in the
Python script.  That way, future versions of this script that support
libvirt (or other backends) won't need to bother setting
CONFIGURE_AWS_ROLES and will still get valid Python here.  The :-
syntax is specified in [2], and my expansion defaults to False if
CONFIGURE_AWS_ROLES is unset or empty.

[1]: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
wking added a commit to wking/openshift-installer that referenced this pull request Aug 24, 2018
I'm not authorized to assume roles in the teamcoreservices account,
and the assume-role call errors out with:

  An error occurred (AccessDenied) when calling the AssumeRole
  operation: Not authorized to perform sts:AssumeRole

That's fine though; I can still launch the cluster with my usual
access.  This commit makes the role assumption optional.  I've made
setting up the AWS_* access variables conditional on successful role
assumption, because setting them based on an empty $RES wouldn't work
;).

Using the && chain with a terminal || keeps the script from dying on
this assume-role failure.  From the 'set -e' docs [1]:

  The shell does not exit if the command that fails is ... part of any
  command executed in a && or || list except the command following the
  final && or ||...

I'm also only setting iamRoleName configs if assume-role succeeded.
We've been setting iamRoleName since the script landed in a2405e4
(run smoke tests with bash script, 2018-06-18,
coreos/tectonic-installer#3284) and possibly before that since
82daae1 (tests: add etcd role, 2018-03-14,
coreos/tectonic-installer#3074).  I don't see anything in those
commits or PRs to motivate the iamRoleName entries, but I'd guess
they, like the tf-tectonic-installer role, are specific to the Jenkins
setup.  I've tied them together with CONFIGURE_AWS_ROLES based on that
similarity, although in theory you may be able to toggle the
iamRoleName settings independently of assume-role success.

Even though the &&/|| chain sets CONFIGURE_AWS_ROLES=False when
assume-role failes, I'm using ${CONFIGURE_AWS_ROLES:-False} in the
Python script.  That way, future versions of this script that support
libvirt (or other backends) won't need to bother setting
CONFIGURE_AWS_ROLES and will still get valid Python here.  The :-
syntax is specified in [2], and my expansion defaults to False if
CONFIGURE_AWS_ROLES is unset or empty.

[1]: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
wking added a commit to wking/openshift-installer that referenced this pull request Aug 24, 2018
I'm not authorized to assume roles in the teamcoreservices account,
and the assume-role call errors out with:

  An error occurred (AccessDenied) when calling the AssumeRole
  operation: Not authorized to perform sts:AssumeRole

That's fine though; I can still launch the cluster with my usual
access.  This commit makes the role assumption optional.  I've made
setting up the AWS_* access variables conditional on successful role
assumption, because setting them based on an empty $RES wouldn't work
;).

Using the && chain with a terminal || keeps the script from dying on
this assume-role failure.  From the 'set -e' docs [1]:

  The shell does not exit if the command that fails is ... part of any
  command executed in a && or || list except the command following the
  final && or ||...

I'm also only setting iamRoleName configs if assume-role succeeded.
We've been setting iamRoleName since the script landed in a2405e4
(run smoke tests with bash script, 2018-06-18,
coreos/tectonic-installer#3284) and possibly before that since
82daae1 (tests: add etcd role, 2018-03-14,
coreos/tectonic-installer#3074).  I don't see anything in those
commits or PRs to motivate the iamRoleName entries, but I'd guess
they, like the tf-tectonic-installer role, are specific to the Jenkins
setup.  I've tied them together with CONFIGURE_AWS_ROLES based on that
similarity, although in theory you may be able to toggle the
iamRoleName settings independently of assume-role success.

Even though the &&/|| chain sets CONFIGURE_AWS_ROLES=False when
assume-role failes, I'm using ${CONFIGURE_AWS_ROLES:-False} in the
Python script.  That way, future versions of this script that support
libvirt (or other backends) won't need to bother setting
CONFIGURE_AWS_ROLES and will still get valid Python here.  The :-
syntax is specified in [2], and my expansion defaults to False if
CONFIGURE_AWS_ROLES is unset or empty.

[1]: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants