Skip to content

Commit

Permalink
add containername debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandredevely committed Aug 30, 2023
1 parent 2fc167f commit cc5faac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions oc/od/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,9 @@ def createappinstance(self, myDesktop, app, authinfo, userinfo={}, userargs=None
# DO NOT USE TOO LONG NAME for container name
# filter can failed or retrieve invalid value in case userid + app.name + uuid
# limit length is not defined but take care
_containername = self.get_normalized_username(userinfo.get('name', 'name')) + '_' + oc.auth.namedlib.normalize_imagename( app['name'] + '_' + str(uuid.uuid4().hex) )
_containername = self.get_normalized_username(userinfo.get('name', 'name')) + '_' + oc.auth.namedlib.normalize_imagename( app['name'] ) + '_' + uuid.uuid4().hex[1:5]
containername = oc.auth.namedlib.normalize_name( _containername )
self.logger.info('containername=%s', containername )

# build the host config
# first load the default hostconfig from od.config for all containers
Expand Down Expand Up @@ -1043,10 +1044,13 @@ def createappinstance(self, myDesktop, app, authinfo, userinfo={}, userargs=None


# dump host config berfore create
self.logger.info('application containername=%s', containername )
self.logger.info('application hostconfig=%s', host_config )

appinfo = infra.createcontainer(
image = app['id'],
network_name = network_name,
host_config = host_config,
name = containername,
working_dir = app['workingdir'],
command = app['cmd'],
Expand All @@ -1060,9 +1064,7 @@ def createappinstance(self, myDesktop, app, authinfo, userinfo={}, userargs=None
'access_parent_id' : desktop.id,
'access_parent_hostname': self.nodehostname
},
volumes = volumes,
host_config = host_config,
network_name = network_name,
volumes = volumes
)

if not isinstance( appinfo, dict) :
Expand Down

0 comments on commit cc5faac

Please sign in to comment.