rookout 0.1.22 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rookout/augs/aug.rb +5 -0
- data/lib/rookout/com_ws/agent_com_ws.rb +6 -0
- data/lib/rookout/com_ws/information.rb +19 -2
- data/lib/rookout/com_ws/output.rb +4 -0
- data/lib/rookout/commit.rb +1 -1
- data/lib/rookout/services/tracer.rb +1 -1
- data/lib/rookout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b41a3be6ece6ef09531502db594ac06453723797d3c9c0f33e61ffe15a67587
|
4
|
+
data.tar.gz: a772b70e1fd6df14a51f1bf74e4938a576ef9b7989692eaf09d658c190789ce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b81e9fb7362fdf9abb57988d9dc2eb0acc099c5149243b1bf4d787c4e05d5aa4f3bc3602214eba23742ba152ac90fc18342a6abd5b872189b53626f007cea71
|
7
|
+
data.tar.gz: 012b9eb8d6a15ba2f267190bc1edd1adea15472bc288e78d936cb592a2726b9bac66ba06067ab111e3757fc3562b8df95d69b013e38a2567f0b4c47385900106
|
data/lib/rookout/augs/aug.rb
CHANGED
@@ -28,6 +28,11 @@ module Rookout
|
|
28
28
|
def execute frame, extracted, output
|
29
29
|
return unless @enabled
|
30
30
|
|
31
|
+
if output.user_messages_queue_full?
|
32
|
+
Logger.instance.warning "Skipping aug-\t#{id} execution because the queue is full"
|
33
|
+
return
|
34
|
+
end
|
35
|
+
|
31
36
|
namespace = create_namespaces frame, extracted
|
32
37
|
return if @condition && !@condition.evaluate(namespace)
|
33
38
|
|
@@ -23,6 +23,8 @@ module Rookout
|
|
23
23
|
class AgentComWs
|
24
24
|
include EventEmitter
|
25
25
|
|
26
|
+
attr_reader :pending_messages
|
27
|
+
|
26
28
|
def initialize output, agent_host, agent_port, proxy, token, labels
|
27
29
|
agent_host_with_protocl = agent_host.include?("://") ? agent_host : "ws://#{agent_host}"
|
28
30
|
@uri = "#{agent_host_with_protocl}:#{agent_port}/v1"
|
@@ -62,6 +64,10 @@ module Rookout
|
|
62
64
|
@pending_messages.push buffer if @pending_messages.length < Config.agent_com_max_queued_messages
|
63
65
|
end
|
64
66
|
|
67
|
+
def queue_full?
|
68
|
+
@pending_messages.length >= Config.agent_com_max_queued_messages
|
69
|
+
end
|
70
|
+
|
65
71
|
def connect
|
66
72
|
@running = true
|
67
73
|
|
@@ -11,11 +11,16 @@ module Rookout
|
|
11
11
|
require_relative "git"
|
12
12
|
include Git
|
13
13
|
|
14
|
-
def initialize labels
|
14
|
+
def initialize labels, k8s_file_path = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
|
15
15
|
@agent_id = nil
|
16
16
|
@labels = labels.clone
|
17
17
|
@labels["rookout_debug"] = "on" if Config.debug
|
18
18
|
|
19
|
+
k8_namespace = create_cluster_namespace k8s_file_path
|
20
|
+
unless k8_namespace == ""
|
21
|
+
@labels["k8s_namespace"] = k8_namespace
|
22
|
+
end
|
23
|
+
|
19
24
|
@ip_addr = local_ip
|
20
25
|
|
21
26
|
@scm_info = create_scm_information
|
@@ -49,7 +54,7 @@ module Rookout
|
|
49
54
|
scm: @scm_info
|
50
55
|
end
|
51
56
|
|
52
|
-
attr_accessor :agent_id
|
57
|
+
attr_accessor :agent_id, :labels
|
53
58
|
|
54
59
|
private
|
55
60
|
|
@@ -65,6 +70,18 @@ module Rookout
|
|
65
70
|
end
|
66
71
|
# rubocop:enable Style/ParallelAssignment
|
67
72
|
|
73
|
+
def create_cluster_namespace k8s_file_path
|
74
|
+
return_value = ""
|
75
|
+
|
76
|
+
# No Kubernetes is valid
|
77
|
+
if File.file? k8s_file_path
|
78
|
+
# Read the file contents and return it as result
|
79
|
+
return_value = File.read k8s_file_path
|
80
|
+
end
|
81
|
+
|
82
|
+
return_value
|
83
|
+
end
|
84
|
+
|
68
85
|
def create_scm_information
|
69
86
|
user_git_origin = Config.user_git_origin || ENV["ROOKOUT_REMOTE_ORIGIN"]
|
70
87
|
user_git_commit = Config.user_git_commit || ENV["ROOKOUT_COMMIT"]
|
@@ -49,6 +49,10 @@ module Rookout
|
|
49
49
|
Logger.instance.remove_output self
|
50
50
|
end
|
51
51
|
|
52
|
+
def user_messages_queue_full?
|
53
|
+
@user_message_bucket.exhausted? || (!@agent_com.nil? && @agent_com.queue_full?)
|
54
|
+
end
|
55
|
+
|
52
56
|
def send_warning rule_id, error
|
53
57
|
send_rule_status rule_id, :Warning, error
|
54
58
|
end
|
data/lib/rookout/commit.rb
CHANGED
data/lib/rookout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rookout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liran Haimovitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: binding_of_caller
|