Class: Gitlab::Serverless::Service
Instance Method Summary
collapse
#clear_memoization, #strong_memoize, #strong_memoized?
Constructor Details
#initialize(attributes) ⇒ Service
Returns a new instance of Service.
6
7
8
|
# File 'lib/gitlab/serverless/service.rb', line 6
def initialize(attributes)
@attributes = attributes
end
|
Instance Method Details
#cluster ⇒ Object
51
52
53
|
# File 'lib/gitlab/serverless/service.rb', line 51
def cluster
@attributes.dig('cluster')
end
|
#created_at ⇒ Object
30
31
32
33
34
35
|
# File 'lib/gitlab/serverless/service.rb', line 30
def created_at
strong_memoize(:created_at) do
timestamp = @attributes.dig('metadata', 'creationTimestamp')
DateTime.parse(timestamp) if timestamp
end
end
|
#description ⇒ Object
47
48
49
|
# File 'lib/gitlab/serverless/service.rb', line 47
def description
knative_07_description || knative_05_06_description
end
|
#environment ⇒ Object
22
23
24
|
# File 'lib/gitlab/serverless/service.rb', line 22
def environment
@attributes.dig('environment')
end
|
#environment_scope ⇒ Object
18
19
20
|
# File 'lib/gitlab/serverless/service.rb', line 18
def environment_scope
@attributes.dig('environment_scope')
end
|
#image ⇒ Object
37
38
39
40
41
42
43
44
45
|
# File 'lib/gitlab/serverless/service.rb', line 37
def image
@attributes.dig(
'spec',
'runLatest',
'configuration',
'build',
'template',
'name')
end
|
#name ⇒ Object
10
11
12
|
# File 'lib/gitlab/serverless/service.rb', line 10
def name
@attributes.dig('metadata', 'name')
end
|
#namespace ⇒ Object
14
15
16
|
# File 'lib/gitlab/serverless/service.rb', line 14
def namespace
@attributes.dig('metadata', 'namespace')
end
|
#podcount ⇒ Object
26
27
28
|
# File 'lib/gitlab/serverless/service.rb', line 26
def podcount
@attributes.dig('podcount')
end
|
#url ⇒ Object
55
56
57
|
# File 'lib/gitlab/serverless/service.rb', line 55
def url
proxy_url || knative_06_07_url || knative_05_url
end
|