Skip to content

Commit

Permalink
Merge pull request #309 from GrahamDumpleton/environment-creation
Browse files Browse the repository at this point in the history
Address possible issue with environment creation in training portal.
  • Loading branch information
GrahamDumpleton authored Feb 26, 2024
2 parents 5bc76fc + b8c6d1e commit 7876b6f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions project-docs/release-notes/version-2.7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,11 @@ Bugs Fixed
opaque data secret. This issue was inadvertantly introduced when support was
added for providing the CA secret as an actual secret rather than being
enmbedded in the data values file when deploying Educates.

* Addressed possible issue with training portal whereby if a transient error
occurred when looking up workshop environment using Kubernetes REST API
immediately after creation, that database update would be rolled back but
the workshop environment in the cluster would still exist, meaning that an
attempt would me made to use the same workshop environment name the next
time one is created, resulting in a conflict and inability to create any
new workshop environments against that training portal.
2 changes: 2 additions & 0 deletions session-manager/handlers/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def send_event_to_webhook(url, message):
def report_analytics_event(event, data={}):
message = None

logging.info("Reporting analytics event %s with data %s.", event, data)

if not ANALYTICS_WEBHOOK_URL:
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def send_event_to_webhook(url, message):
def report_analytics_event(entity, event, data={}):
message = None

logging.info("Reporting analytics event %s with data %s.", event, data)

if not settings.ANALYTICS_WEBHOOK_URL:
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,14 @@ def process_workshop_environment(portal, workshop, position):
resource = K8SWorkshopEnvironment(api, environment_body)
resource.create()

instance = K8SWorkshopEnvironment.objects(api).get(name=environment.name)
environment.uid = resource.metadata["uid"]

environment.uid = instance.metadata["uid"]
logging.info(
"Successfully created workshop environment %s for workshop %s with uid %s.",
environment.name,
workshop["name"],
resource.metadata["uid"]
)

# Finally save the record again. The workshop environment is left in
# starting state. It will only be progressed to running state when we
Expand Down

0 comments on commit 7876b6f

Please sign in to comment.