-
Notifications
You must be signed in to change notification settings - Fork 365
Optionally disallow the use of 'root' user for Processes and Tasks of docker lifecycle Apps #4452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
acosta11 marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ def create_or_update_app(process, client) | |
if e.name == 'RunnerError' && e.message['the requested resource already exists'] | ||
existing_lrp = client.get_app(process) | ||
client.update_app(process, existing_lrp) | ||
elsif e.name == 'UnprocessableEntity' | ||
raise | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should just be re-raising all errors here. I'm checking with @sethboyles out-of-band about 133486e. |
||
end | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,18 @@ module Diego | |
expect(client).to have_received(:get_app).exactly(2).times | ||
end | ||
end | ||
|
||
context 'when root user is not permitted' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: This context is more specific than the implemented logic; any |
||
it 'raises a CloudController::Errors::ApiError' do | ||
allow(client).to receive(:desire_app).and_raise(CloudController::Errors::ApiError.new_from_details('UnprocessableEntity', | ||
'Attempting to run process as root user, which is not permitted.')) | ||
expect { DesireAppHandler.create_or_update_app(process, client) }.to(raise_error do |error| | ||
expect(error).to be_a(CloudController::Errors::ApiError) | ||
expect(error.name).to eq('UnprocessableEntity') | ||
expect(error.message).to include('Attempting to run process as root user, which is not permitted') | ||
end) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
Uh oh!
There was an error while loading. Please reload this page.