kube_auto_analyzer 0.0.11 → 0.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09c9995df2634767b1636a705fb338e39cbe6036
4
- data.tar.gz: 5e6c72755d2de74ede901f32b9c177e08e1ee092
3
+ metadata.gz: d99eb5b07cc86404cdd7c047749d9c1b6d21adb1
4
+ data.tar.gz: 9353e76146495023ba33aa292de226dea388d950
5
5
  SHA512:
6
- metadata.gz: 8a8e2f58b772b0ba5afea48f8116fea776a72cc7b12574465a54680c71ce3d5e1b00210a5d5f26a4035352053f4e022b0858afd211a8bfd8e5b4bd59104658bb
7
- data.tar.gz: 25a22b6257b640ef773bf1615b1be42faabc71d74c1141cf9e6433fa999d0489c11195d07d8c5bcbd00fddc34d90ebacf893b8880f157d4639a7621af3a1d88b
6
+ metadata.gz: 25b50282a16a2ba5acaef4987159ecfece28d44a3a0b182d532264a5f3e161100ca3198a6a0ff23f0e5d54869d1e93f729f6c5728145cb5386e92d33056353c9
7
+ data.tar.gz: 5dd0b75a81ffa473fbd2c93a0fdcecdc516aaeb0f20f9fd64a363f93180ef055b9cc52e8b5ee7d383c72e888f954f236b1673c112eeb262903aaa17cde71f64b
data/bin/kubeautoanalyzer CHANGED
@@ -15,6 +15,7 @@
15
15
  options.config_file = false
16
16
  options.agent_checks = false
17
17
  options.insecure = false
18
+ options.context = false
18
19
 
19
20
 
20
21
  opts = OptionParser.new do |opts|
@@ -27,6 +28,10 @@
27
28
  options.config_file = file
28
29
  end
29
30
 
31
+ opts.on("--context [CONTEXT]", "context to use from kubeconfig") do |context|
32
+ options.context = context
33
+ end
34
+
30
35
  opts.on("-s", "--server [SERVER]", "Target Server") do |serv|
31
36
  options.target_server = serv
32
37
  end
@@ -1,3 +1,3 @@
1
1
  module KubeAutoAnalyzer
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -52,8 +52,11 @@ module KubeAutoAnalyzer
52
52
  @log.debug("About to start API Server check pod")
53
53
  @client.create_pod(pod)
54
54
  @log.debug("Executed the create pod")
55
+ sleep_count = 0
55
56
  begin
56
57
  sleep(5) until @client.get_pod(container_name,"default")['status']['containerStatuses'][0]['state']['terminated']['reason'] == "Completed"
58
+ sleep_count = sleep_count + 1
59
+ @log.debug("Waited #{(5 * sleep_count).to_s} seconds for the API Server Check Pod")
57
60
  rescue
58
61
  retry
59
62
  end
@@ -60,22 +60,27 @@ module KubeAutoAnalyzer
60
60
  else
61
61
  begin
62
62
  config = Kubeclient::Config.read(@options.config_file)
63
+ if @options.context
64
+ context = config.context(@options.context)
65
+ else
66
+ context = config.context
67
+ end
63
68
  rescue Errno::ENOENT
64
69
  puts "Config File could not be read, check the path?"
65
70
  exit
66
71
  end
67
72
  @client = Kubeclient::Client.new(
68
- config.context.api_endpoint,
69
- config.context.api_version,
73
+ context.api_endpoint,
74
+ context.api_version,
70
75
  {
71
- ssl_options: config.context.ssl_options,
72
- auth_options: config.context.auth_options
76
+ ssl_options: context.ssl_options,
77
+ auth_options: context.auth_options
73
78
  }
74
79
  )
75
80
  #We didn't specify the target on the command line so lets get it from the config file
76
- @options.target_server = config.context.api_endpoint
81
+ @options.target_server = context.api_endpoint
77
82
  @log.debug("target is " + @options.target_server)
78
- @results[config.context.api_endpoint] = Hash.new
83
+ @results[context.api_endpoint] = Hash.new
79
84
  end
80
85
  #Test response
81
86
  begin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kube_auto_analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rory McCune
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler