Skip to content
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

Remove validation preventing both name and os for stemcells. #2485

Merged
merged 1 commit into from
Jan 9, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ def validate(manifest)
'resource_pools is no longer supported. You must now define resources in a cloud-config'
end

if manifest.key?('stemcells')
manifest['stemcells'].each do |stemcell|
if stemcell['name'] && stemcell['os']
raise StemcellBothNameAndOS, "Properties 'os' and 'name' are both specified for stemcell, choose one. (#{stemcell})"
end
end
end

Config.event_log.warn_deprecated("Global 'properties' are deprecated. Please define 'properties' at the job level.") if manifest.key?('properties')
end

Expand Down
1 change: 0 additions & 1 deletion src/bosh-director/lib/bosh/director/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def self.err(error_code, response_code = BAD_REQUEST)
StemcellNotFound = err(50003, NOT_FOUND)
StemcellInUse = err(50004)
StemcellAliasAlreadyExists = err(50005)
StemcellBothNameAndOS = err(50006)
StemcellSha1DoesNotMatch = err(50007)
StemcellNotSupported = err(50008)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ module Director
'resource_pools is no longer supported. You must now define resources in a cloud-config',
)
end

it 'raises error when both os and name are specified for a stemcell' do
manifest_hash['stemcells'][0]['name'] = 'the-name'

expect do
manifest_validator.validate(manifest_hash)
end.to raise_error(
Bosh::Director::StemcellBothNameAndOS,
%[Properties 'os' and 'name' are both specified for stemcell, choose one. ({"alias"=>"default", "os"=>"toronto-os", "version"=>"latest", "name"=>"the-name"})],
)
end
end
end
end
Expand Down
Loading