Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/actions/space_diff_manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def generate_diff(app_manifests, space)

remove_default_missing_fields(existing_value, key, value) if nested_attribute_exists

remove_unspecified_app_features(existing_value, key, value)
remove_unspecified_app_features(existing_value, key, value) if existing_value.present?

# To preserve backwards compability, we've decided to skip diffs that satisfy this conditon
next if !nested_attribute_exists && %w[disk_quota disk-quota memory].include?(key)
Expand Down
8 changes: 6 additions & 2 deletions spec/unit/actions/space_diff_manifest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,19 @@ module VCAP::CloudController
'name' => 'new-app'
},
{
'name' => 'newer-app'
'name' => 'newer-app',
'features' => {
'ssh' => true
}
}
]
end

it 'returns the correct diff' do
expect(subject).to eq([
{ 'op' => 'add', 'path' => '/applications/0/name', 'value' => 'new-app' },
{ 'op' => 'add', 'path' => '/applications/1/name', 'value' => 'newer-app' }
{ 'op' => 'add', 'path' => '/applications/1/name', 'value' => 'newer-app' },
{ 'op' => 'add', 'path' => '/applications/1/features', 'value' => { 'ssh' => true } }
])
end
end
Expand Down
Loading