-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate out git application support and restructure code to support it.
- Loading branch information
1 parent
f4aa5e3
commit 7783f57
Showing
5 changed files
with
190 additions
and
112 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import random | ||
import string | ||
|
||
from .operator_config import OPERATOR_API_GROUP, INGRESS_DOMAIN, INGRESS_PROTOCOL | ||
|
||
|
||
def git_workshop_spec_patches(application_properties): | ||
characters = string.ascii_letters + string.digits | ||
|
||
git_host = f"git-$(session_namespace).{INGRESS_DOMAIN}" | ||
git_username = "$(session_namespace)" | ||
git_password = "".join(random.sample(characters, 32)) | ||
|
||
return { | ||
"spec": { | ||
"session": { | ||
"ingresses": [ | ||
{"name": "git", "port": 10087, "authentication": {"type": "none"}} | ||
], | ||
"variables": [ | ||
{ | ||
"name": "git_protocol", | ||
"value": INGRESS_PROTOCOL, | ||
}, | ||
{ | ||
"name": "git_host", | ||
"value": git_host, | ||
}, | ||
{ | ||
"name": "git_username", | ||
"value": git_username, | ||
}, | ||
{ | ||
"name": "git_password", | ||
"value": git_password, | ||
}, | ||
], | ||
"env": [ | ||
{ | ||
"name": "GIT_PROTOCOL", | ||
"value": INGRESS_PROTOCOL, | ||
}, | ||
{ | ||
"name": "GIT_HOST", | ||
"value": git_host, | ||
}, | ||
{ | ||
"name": "GIT_USERNAME", | ||
"value": git_username, | ||
}, | ||
{ | ||
"name": "GIT_PASSWORD", | ||
"value": git_password, | ||
}, | ||
], | ||
} | ||
} | ||
} | ||
|
||
|
||
def git_environment_objects_list(application_properties): | ||
return [] | ||
|
||
|
||
def git_session_objects_list(application_properties): | ||
return [] | ||
|
||
|
||
def git_pod_template_spec_patches(application_properties): | ||
return {} |
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
Oops, something went wrong.