@@ -34,7 +34,6 @@ def after_initialize
3434 NO_APP_PORT_SPECIFIED = -1
3535 DEFAULT_HTTP_PORT = 8080
3636 DEFAULT_PORTS = [ DEFAULT_HTTP_PORT ] . freeze
37- DEFAULT_USER = 'vcap' . freeze
3837 UNLIMITED_LOG_RATE = -1
3938
4039 many_to_one :app , class : 'VCAP::CloudController::AppModel' , key : :app_guid , primary_key : :guid , without_guid_generation : true
@@ -396,7 +395,7 @@ def started_command
396395 def run_action_user
397396 return user if user . present?
398397
399- docker? ? docker_run_action_user : DEFAULT_USER
398+ docker? ? docker_run_action_user : AppModel :: DEFAULT_USER
400399 end
401400
402401 def specified_or_detected_command
@@ -456,6 +455,8 @@ def debug
456455
457456 delegate :windows_gmsa_credential_refs , to : :app
458457
458+ delegate :permitted_users , to : :app
459+
459460 def database_uri
460461 service_binding_uris = service_bindings . map do |binding |
461462 binding . credentials [ 'uri' ] if binding . credentials . present?
@@ -572,24 +573,8 @@ def open_ports
572573
573574 private
574575
575- def permitted_users
576- Set . new ( [ DEFAULT_USER ] ) + Config . config . get ( :additional_allowed_process_users )
577- end
578-
579576 def docker_run_action_user
580- return DEFAULT_USER unless docker?
581-
582- container_user = ''
583- if execution_metadata . present?
584- begin
585- docker_exec_metadata = Oj . load ( execution_metadata )
586- container_user = docker_exec_metadata [ 'user' ]
587- rescue EncodingError
588- container_user = ''
589- end
590- end
591-
592- container_user . presence || 'root'
577+ desired_droplet . docker_user . presence || AppModel ::DEFAULT_USER
593578 end
594579
595580 def non_unique_process_types
0 commit comments