Module: Gitlab::Ci::Config::Entry::Imageable
Overview
Represents Imageable concern shared by Image and Service.
Constant Summary
collapse
- EXECUTOR_OPTS_KEYS =
%i[docker kubernetes].freeze
- IMAGEABLE_ALLOWED_KEYS =
EXECUTOR_OPTS_KEYS + %i[name entrypoint ports pull_policy].freeze
Instance Method Summary
collapse
#compose!, #entry_create!
Instance Method Details
#entrypoint ⇒ Object
49
50
51
|
# File 'lib/gitlab/ci/config/entry/imageable.rb', line 49
def entrypoint
value[:entrypoint]
end
|
#executor_opts ⇒ Object
61
62
63
64
65
|
# File 'lib/gitlab/ci/config/entry/imageable.rb', line 61
def executor_opts
return unless config.is_a?(Hash)
config.slice(*EXECUTOR_OPTS_KEYS).compact.presence
end
|
#name ⇒ Object
45
46
47
|
# File 'lib/gitlab/ci/config/entry/imageable.rb', line 45
def name
value[:name]
end
|
#skip_config_hash_validation? ⇒ Boolean
57
58
59
|
# File 'lib/gitlab/ci/config/entry/imageable.rb', line 57
def skip_config_hash_validation?
true
end
|
#value ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/gitlab/ci/config/entry/imageable.rb', line 67
def value
if string?
{ name: config }
elsif hash?
{
name: config[:name],
entrypoint: config[:entrypoint],
executor_opts: executor_opts,
ports: (ports_value if ports_defined?),
pull_policy: pull_policy_value
}.compact
else
{}
end
end
|
#with_image_ports? ⇒ Boolean
53
54
55
|
# File 'lib/gitlab/ci/config/entry/imageable.rb', line 53
def with_image_ports?
opt(:with_image_ports)
end
|