forked from mesosphere/dcos-jenkins-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add sdk_dcos to get DCOS metadata * Add strict mode deployment Add the ability to deploy Jenkins on a strict mode cluster. This handles detecting the security mode of the cluster, creating the service account and secrets, and properly configuring the mesos credentials in Jenkins. * Add test for change_mesos_creds
- Loading branch information
1 parent
310f419
commit 08e19bd
Showing
5 changed files
with
133 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'''Utilities relating to getting information about DC/OS itself | ||
************************************************************************ | ||
FOR THE TIME BEING WHATEVER MODIFICATIONS ARE APPLIED TO THIS FILE | ||
SHOULD ALSO BE APPLIED TO sdk_dcos IN ANY OTHER PARTNER REPOS | ||
************************************************************************ | ||
''' | ||
from enum import Enum | ||
|
||
import sdk_cmd | ||
|
||
|
||
class DCOS_SECURITY(Enum): | ||
disabled = 1 | ||
permissive = 2 | ||
strict = 3 | ||
|
||
|
||
def get_metadata(): | ||
return sdk_cmd.cluster_request('GET', | ||
'dcos-metadata/bootstrap-config.json', | ||
retry=False) | ||
|
||
|
||
def get_security_mode() -> DCOS_SECURITY: | ||
r = get_metadata().json() | ||
mode = r['security'] | ||
return DCOS_SECURITY[mode] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters