kennel 1.61.4 → 1.61.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddec1e52bda24d78c94d0cce08ef0ec8069831d21fa7b5c708093173a1d17b7e
4
- data.tar.gz: 16ce37dbdfdd641b358800a75c54183a430d31536e68ad821fe48d7ada98129c
3
+ metadata.gz: c170afd5f8bc8223b9b7d37bf48a1de593d643fa7de785ec8fc26e631bcdf81c
4
+ data.tar.gz: 89ec3660c0b7a1022a104a6d6b51eda9ec3291a1bb9cf46d2ae303597e66c30b
5
5
  SHA512:
6
- metadata.gz: 76747928bf1fc2b8208add017d9f43953366f5de8c0b305cfe74b725ddd8bc40a02d2593b4c00a9d4f1f43652c32e83bd3261424ef2e9fe55a0f01b61a5b7190
7
- data.tar.gz: 34ec05f6b7d198fea07a20c7bcf4fdd580c4551fc07d0c61c9820f37da9968994f6da9f4301db37d31d3a76a73ed63cb3f3529b1f2838ade6974607e02b784a8
6
+ metadata.gz: a68a43cf73743f9f098259dd5c614cdc6ced148d08cf629907f090689804148e01e857a4434f9410607fec338e3cca50f883e4dfe31200e48b80dffbbb7ff379
7
+ data.tar.gz: d5c5bf8a43c526611162267d6c4babb64a57aab4d0eddbb0cbf9e1fb507f0066528c6e82f7651911fdfd86d74c6ae520b634c7b0de1b799d8d55a1c695f0e457
@@ -132,16 +132,16 @@ module Kennel
132
132
  when "uptime"
133
133
  if ids = definition[:monitor_ids]
134
134
  definition[:monitor_ids] = ids.map do |id|
135
- tracking_id?(id) ? resolve_link(id, id_map) : id
135
+ tracking_id?(id) ? resolve_link(id, :monitor, id_map) : id
136
136
  end
137
137
  end
138
138
  when "alert_graph"
139
139
  if (id = definition[:alert_id]) && tracking_id?(id)
140
- definition[:alert_id] = resolve_link(id, id_map).to_s
140
+ definition[:alert_id] = resolve_link(id, :monitor, id_map).to_s
141
141
  end
142
142
  when "slo"
143
143
  if (id = definition[:slo_id]) && tracking_id?(id)
144
- definition[:slo_id] = resolve_link(id, id_map).to_s
144
+ definition[:slo_id] = resolve_link(id, :slo, id_map).to_s
145
145
  end
146
146
  end
147
147
  end
@@ -150,7 +150,7 @@ module Kennel
150
150
  private
151
151
 
152
152
  def tracking_id?(id)
153
- id.is_a?(String) && !id.match?(/\A\d+\z/)
153
+ id.is_a?(String) && id.include?(":")
154
154
  end
155
155
 
156
156
  # creates queries from metadata to avoid having to keep q and expression in sync
@@ -106,7 +106,7 @@ module Kennel
106
106
  if as_json[:type] == "composite"
107
107
  as_json[:query] = as_json[:query].gsub(/%\{(.*?)\}/) do
108
108
  # need force here since it validates the id exists
109
- resolve_link($1, id_map, force: true)
109
+ resolve_link($1, :monitor, id_map, force: true)
110
110
  end
111
111
  end
112
112
  end
@@ -54,7 +54,7 @@ module Kennel
54
54
 
55
55
  private
56
56
 
57
- def resolve_link(id, id_map, force: false)
57
+ def resolve_link(id, type, id_map, force: false)
58
58
  found = id_map[id]
59
59
  return found if found && found != :new
60
60
  api_resource = self.class.api_resource
@@ -67,7 +67,7 @@ module Kennel
67
67
  Kennel::MISSING_ID
68
68
  end
69
69
  else
70
- invalid! "Unable to find #{api_resource} #{id} (does not exist and is not being created by the current run)"
70
+ invalid! "Unable to find #{type} #{id} (does not exist and is not being created by the current run)"
71
71
  end
72
72
  end
73
73
 
@@ -55,7 +55,7 @@ module Kennel
55
55
 
56
56
  def resolve_linked_tracking_ids(id_map)
57
57
  as_json[:monitor_ids] = as_json[:monitor_ids].map do |id|
58
- id.is_a?(String) ? resolve_link(id, id_map) : id
58
+ id.is_a?(String) ? resolve_link(id, :monitor, id_map) : id
59
59
  end
60
60
  end
61
61
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.61.4"
3
+ VERSION = "1.61.5"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.61.4
4
+ version: 1.61.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser