Remove Gitlab::Ci::Config::Entry::DockerImage
This commit is contained in:
parent
3e75fd6c5b
commit
645c865141
|
@ -1,31 +0,0 @@
|
|||
module Gitlab
|
||||
module Ci
|
||||
class Config
|
||||
module Entry
|
||||
module DockerImage
|
||||
def hash?
|
||||
@config.is_a?(Hash)
|
||||
end
|
||||
|
||||
def string?
|
||||
@config.is_a?(String)
|
||||
end
|
||||
|
||||
def name
|
||||
value[:name]
|
||||
end
|
||||
|
||||
def entrypoint
|
||||
value[:entrypoint]
|
||||
end
|
||||
|
||||
def value
|
||||
return { name: @config } if string?
|
||||
return @config if hash?
|
||||
{}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -7,7 +7,6 @@ module Gitlab
|
|||
#
|
||||
class Image < Node
|
||||
include Validatable
|
||||
include DockerImage
|
||||
|
||||
ALLOWED_KEYS = %i[name entrypoint].freeze
|
||||
|
||||
|
@ -18,6 +17,28 @@ module Gitlab
|
|||
validates :name, type: String, presence: true
|
||||
validates :entrypoint, type: String, allow_nil: true
|
||||
end
|
||||
|
||||
def hash?
|
||||
@config.is_a?(Hash)
|
||||
end
|
||||
|
||||
def string?
|
||||
@config.is_a?(String)
|
||||
end
|
||||
|
||||
def name
|
||||
value[:name]
|
||||
end
|
||||
|
||||
def entrypoint
|
||||
value[:entrypoint]
|
||||
end
|
||||
|
||||
def value
|
||||
return { name: @config } if string?
|
||||
return @config if hash?
|
||||
{}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,9 +5,8 @@ module Gitlab
|
|||
##
|
||||
# Entry that represents a configuration of Docker service.
|
||||
#
|
||||
class Service < Node
|
||||
class Service < Image
|
||||
include Validatable
|
||||
include DockerImage
|
||||
|
||||
ALLOWED_KEYS = %i[name entrypoint command alias].freeze
|
||||
|
||||
|
|
Loading…
Reference in New Issue