kubecontrol 0.1.1
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 +7 -0
- data/.github/workflows/gempush.yml +44 -0
- data/.github/workflows/ruby.yml +20 -0
- data/.gitignore +28 -0
- data/.rspec +3 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +43 -0
- data/LICENSE +21 -0
- data/README.md +51 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/kubecontrol.gemspec +27 -0
- data/lib/kubecontrol/client.rb +34 -0
- data/lib/kubecontrol/pod.rb +23 -0
- data/lib/kubecontrol/version.rb +3 -0
- data/lib/kubecontrol.rb +7 -0
- data/spec/kubecontrol/client_spec.rb +92 -0
- data/spec/kubecontrol/pod_spec.rb +61 -0
- data/spec/kubecontrol_spec.rb +5 -0
- data/spec/spec_helper.rb +88 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 65dc046ec4edab7fe2699ece898e666aa7102bf6c4038a633bee75c7c4920b46
|
4
|
+
data.tar.gz: 3ef2d900864e590b16c0dcf573bea8ef00bc0327e1b7a2ca435a3d1f1448c86b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 367b418c7e904dfc42960ec3ae3fa4bc8584dc3997e0ebbd45b1c4f05650d8c3e1529b2c0c832a484e9cd1571332a9e831f7de0c6c3e0a20894b0c220d651352
|
7
|
+
data.tar.gz: dc448d8c8dc75dc0a3d38c17a45ed856a2a89f3f64daf55160fef1e38b506d89a6ff84cf5593936a626e0202484372427b931d9c27502a7375d421c7f2a6e1ba
|
@@ -0,0 +1,44 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
push:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
build:
|
13
|
+
name: Build + Publish
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@master
|
18
|
+
- name: Set up Ruby 2.6
|
19
|
+
uses: actions/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
version: 2.6.x
|
22
|
+
|
23
|
+
- name: Publish to GPR
|
24
|
+
run: |
|
25
|
+
mkdir -p $HOME/.gem
|
26
|
+
touch $HOME/.gem/credentials
|
27
|
+
chmod 0600 $HOME/.gem/credentials
|
28
|
+
printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
29
|
+
gem build *.gemspec
|
30
|
+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
31
|
+
env:
|
32
|
+
GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}}
|
33
|
+
OWNER: madkin10
|
34
|
+
|
35
|
+
- name: Publish to RubyGems
|
36
|
+
run: |
|
37
|
+
mkdir -p $HOME/.gem
|
38
|
+
touch $HOME/.gem/credentials
|
39
|
+
chmod 0600 $HOME/.gem/credentials
|
40
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
41
|
+
gem build *.gemspec
|
42
|
+
gem push *.gem
|
43
|
+
env:
|
44
|
+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v1
|
12
|
+
- name: Set up Ruby 2.6
|
13
|
+
uses: actions/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: 2.6.x
|
16
|
+
- name: Build and test with Rake
|
17
|
+
run: |
|
18
|
+
gem install bundler
|
19
|
+
bundle install --jobs 4 --retry 3
|
20
|
+
bundle exec rake
|
data/.gitignore
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
|
10
|
+
# rspec failure tracking
|
11
|
+
.rspec_status
|
12
|
+
|
13
|
+
# Ignore all logfiles and tempfiles.
|
14
|
+
/log/*
|
15
|
+
/tmp/*
|
16
|
+
!/log/.keep
|
17
|
+
!/tmp/.keep
|
18
|
+
.log
|
19
|
+
*.log
|
20
|
+
*.lock
|
21
|
+
!Gemfile.lock
|
22
|
+
*.out
|
23
|
+
|
24
|
+
.byebug_history
|
25
|
+
.vscode/*
|
26
|
+
.idea
|
27
|
+
.DS_Store
|
28
|
+
coverage
|
data/.rspec
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
kubecontrol (0.1.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.3)
|
10
|
+
docile (1.3.2)
|
11
|
+
json (2.2.0)
|
12
|
+
rake (13.0.1)
|
13
|
+
rspec (3.9.0)
|
14
|
+
rspec-core (~> 3.9.0)
|
15
|
+
rspec-expectations (~> 3.9.0)
|
16
|
+
rspec-mocks (~> 3.9.0)
|
17
|
+
rspec-core (3.9.0)
|
18
|
+
rspec-support (~> 3.9.0)
|
19
|
+
rspec-expectations (3.9.0)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.9.0)
|
22
|
+
rspec-mocks (3.9.0)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.9.0)
|
25
|
+
rspec-support (3.9.0)
|
26
|
+
simplecov (0.17.1)
|
27
|
+
docile (~> 1.1)
|
28
|
+
json (>= 1.8, < 3)
|
29
|
+
simplecov-html (~> 0.10.0)
|
30
|
+
simplecov-html (0.10.2)
|
31
|
+
|
32
|
+
PLATFORMS
|
33
|
+
ruby
|
34
|
+
|
35
|
+
DEPENDENCIES
|
36
|
+
bundler (~> 2.0)
|
37
|
+
kubecontrol!
|
38
|
+
rake (~> 13.0)
|
39
|
+
rspec (~> 3.0)
|
40
|
+
simplecov (~> 0.17)
|
41
|
+
|
42
|
+
BUNDLED WITH
|
43
|
+
2.0.2
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019-2020 Marco Adkins
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# Kubecontrol
|
2
|
+
|
3
|
+
Simple ruby wrapper for `kubectl` commands
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'kubecontrol'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install kubecontrol
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'kubecontrol'
|
25
|
+
|
26
|
+
# create new client
|
27
|
+
kubectl_client = Kubecontrol.client.new
|
28
|
+
|
29
|
+
# all pods for namespace
|
30
|
+
pods = kubectl_client.pods
|
31
|
+
|
32
|
+
# find pod by name regex
|
33
|
+
pod = kubectl_client.find_pod_by_name /foo-api-.*/
|
34
|
+
|
35
|
+
# access pod information
|
36
|
+
pod.name
|
37
|
+
pod.ready
|
38
|
+
pod.status
|
39
|
+
pod.restarts
|
40
|
+
pod.age
|
41
|
+
```
|
42
|
+
|
43
|
+
## Development
|
44
|
+
|
45
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
46
|
+
|
47
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
48
|
+
|
49
|
+
## Contributing
|
50
|
+
|
51
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/madkin10/kubecontrol.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "kubecontrol"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/kubecontrol.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'kubecontrol/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'kubecontrol'
|
7
|
+
spec.version = Kubecontrol::VERSION
|
8
|
+
spec.authors = ['Marco Adkins']
|
9
|
+
spec.email = ['marcoadkins88@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = 'Simple ruby wrapper for `kubectl` commands'
|
12
|
+
spec.homepage = 'https://github.com/madkin10/kubecontrol'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
16
|
+
spec.metadata['source_code_uri'] = 'https://github.com/madkin10/kubecontrol'
|
17
|
+
spec.metadata['changelog_uri'] = 'https://github.com/madkin10/kubecontrol/master/CHANGELOG.md'
|
18
|
+
|
19
|
+
spec.files = `git ls-files`.split("\n")
|
20
|
+
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
24
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
26
|
+
spec.add_development_dependency 'simplecov', '~> 0.17'
|
27
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative 'pod'
|
2
|
+
|
3
|
+
module Kubecontrol
|
4
|
+
class Client
|
5
|
+
DEFAULT_NAMESPACE = 'default'.freeze
|
6
|
+
|
7
|
+
attr_accessor :namespace
|
8
|
+
|
9
|
+
def initialize(namespace = DEFAULT_NAMESPACE)
|
10
|
+
@namespace = namespace
|
11
|
+
end
|
12
|
+
|
13
|
+
def pods
|
14
|
+
get_pods_result = kubectl_command('get pods')
|
15
|
+
return [] if get_pods_result.empty?
|
16
|
+
|
17
|
+
pods_array = get_pods_result.split
|
18
|
+
pods_array.shift 5 # remove output table headers
|
19
|
+
pods_array.each_slice(5).map do |pod_data|
|
20
|
+
Pod.new(*pod_data)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def find_pod_by_name(name_regex)
|
25
|
+
pods.find { |pod| pod.name.match?(name_regex) }
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def kubectl_command(command)
|
31
|
+
`kubectl -n #{namespace} #{command}`
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Kubecontrol
|
2
|
+
class Pod
|
3
|
+
RUNNING = 'Running'.freeze
|
4
|
+
|
5
|
+
attr_reader :name, :ready, :status, :restarts, :age
|
6
|
+
|
7
|
+
def initialize(name, ready, status, restarts, age)
|
8
|
+
@name = name
|
9
|
+
@ready = ready
|
10
|
+
@status = status
|
11
|
+
@restarts = restarts
|
12
|
+
@age = age
|
13
|
+
end
|
14
|
+
|
15
|
+
def stopped?
|
16
|
+
@status != RUNNING
|
17
|
+
end
|
18
|
+
|
19
|
+
def running?
|
20
|
+
@status == RUNNING
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/kubecontrol.rb
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Kubecontrol::Client do
|
4
|
+
let(:custom_namespace) { 'custom_namespace' }
|
5
|
+
let(:pod_name) { 'foo_pod' }
|
6
|
+
let(:pod_ready) { '1/1' }
|
7
|
+
let(:pod_status) { 'Running' }
|
8
|
+
let(:pod_restarts) { '0' }
|
9
|
+
let(:pod_age) { '20d' }
|
10
|
+
let(:get_pods_response) do
|
11
|
+
<<~RUBY
|
12
|
+
NAME READY STATUS RESTARTS AGE
|
13
|
+
#{pod_name} #{pod_ready} #{pod_status} #{pod_restarts} #{pod_age}
|
14
|
+
RUBY
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '#initialize' do
|
18
|
+
subject { Kubecontrol::Client }
|
19
|
+
|
20
|
+
it 'defaults the namespace' do
|
21
|
+
expect(subject.new.namespace).to eq Kubecontrol::Client::DEFAULT_NAMESPACE
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'accepts namespace as a parameter' do
|
25
|
+
expect(subject.new(custom_namespace).namespace).to eq custom_namespace
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#namespace=' do
|
30
|
+
subject { Kubecontrol::Client.new }
|
31
|
+
it 'updates the namespace on the class' do
|
32
|
+
expect { subject.namespace = custom_namespace }
|
33
|
+
.to change(subject, :namespace)
|
34
|
+
.from(Kubecontrol::Client::DEFAULT_NAMESPACE)
|
35
|
+
.to(custom_namespace)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#namespace' do
|
40
|
+
subject { Kubecontrol::Client.new }
|
41
|
+
it 'returns the namespace on the class' do
|
42
|
+
expect(subject.namespace).to eq Kubecontrol::Client::DEFAULT_NAMESPACE
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#pods' do
|
47
|
+
subject { Kubecontrol::Client.new.pods }
|
48
|
+
|
49
|
+
it 'send a kubectl request to the command line' do
|
50
|
+
expect_any_instance_of(Kubecontrol::Client).to receive(:`).with('kubectl -n default get pods').and_return ''
|
51
|
+
subject
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'returns an array of Kubecontrol::Pods' do
|
55
|
+
allow_any_instance_of(Kubecontrol::Client).to receive(:`).and_return get_pods_response
|
56
|
+
result = subject
|
57
|
+
expect(result).to be_an_instance_of Array
|
58
|
+
expect(result.length).to eq 1
|
59
|
+
expect(result.first).to be_an_instance_of Kubecontrol::Pod
|
60
|
+
end
|
61
|
+
|
62
|
+
context 'no pods found' do
|
63
|
+
before do
|
64
|
+
allow_any_instance_of(Kubecontrol::Client).to receive(:`).and_return ''
|
65
|
+
end
|
66
|
+
|
67
|
+
it { is_expected.to be_empty }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe '#find_pod_by_name' do
|
72
|
+
subject { Kubecontrol::Client.new.find_pod_by_name(pod_name) }
|
73
|
+
|
74
|
+
before do
|
75
|
+
allow_any_instance_of(Kubecontrol::Client).to receive(:`).and_return get_pods_response
|
76
|
+
end
|
77
|
+
|
78
|
+
it { is_expected.to be_an_instance_of Kubecontrol::Pod }
|
79
|
+
|
80
|
+
it 'returns the correct pod' do
|
81
|
+
expect(subject.name).to eq pod_name
|
82
|
+
end
|
83
|
+
|
84
|
+
context 'pod does not exist' do
|
85
|
+
before do
|
86
|
+
allow_any_instance_of(Kubecontrol::Client).to receive(:`).and_return ''
|
87
|
+
end
|
88
|
+
|
89
|
+
it { is_expected.to be_nil }
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Kubecontrol::Pod do
|
4
|
+
let(:pod_name) { 'foo_pod' }
|
5
|
+
let(:pod_ready) { '1/1' }
|
6
|
+
let(:pod_status) { 'Running' }
|
7
|
+
let(:pod_restarts) { '0' }
|
8
|
+
let(:pod_age) { '20d' }
|
9
|
+
|
10
|
+
describe '#initialize' do
|
11
|
+
subject { Kubecontrol::Pod.new(pod_name, pod_ready, pod_status, pod_restarts, pod_age) }
|
12
|
+
|
13
|
+
it 'sets the pod name field' do
|
14
|
+
expect(subject.name).to eq pod_name
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'sets the pod ready field' do
|
18
|
+
expect(subject.ready).to eq pod_ready
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'sets the pod status field' do
|
22
|
+
expect(subject.status).to eq pod_status
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'sets the pod restarts field' do
|
26
|
+
expect(subject.restarts).to eq pod_restarts
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'sets the pod age field' do
|
30
|
+
expect(subject.age).to eq pod_age
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#running?' do
|
35
|
+
subject { Kubecontrol::Pod.new(pod_name, pod_ready, pod_status, pod_restarts, pod_age).running? }
|
36
|
+
|
37
|
+
context 'is running' do
|
38
|
+
it { is_expected.to eq true }
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'is NOT running' do
|
42
|
+
let(:pod_status) { 'Terminated' }
|
43
|
+
|
44
|
+
it { is_expected.to eq false }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#stopped?' do
|
49
|
+
subject { Kubecontrol::Pod.new(pod_name, pod_ready, pod_status, pod_restarts, pod_age).stopped? }
|
50
|
+
|
51
|
+
context 'is running' do
|
52
|
+
it { is_expected.to eq false }
|
53
|
+
end
|
54
|
+
|
55
|
+
context 'is NOT running' do
|
56
|
+
let(:pod_status) { 'Terminated' }
|
57
|
+
|
58
|
+
it { is_expected.to eq true }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'rspec'
|
3
|
+
require 'kubecontrol'
|
4
|
+
require 'simplecov'
|
5
|
+
|
6
|
+
SimpleCov.start unless SimpleCov.running
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
# rspec-expectations config goes here. You can use an alternate
|
10
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
11
|
+
# assertions if you prefer.
|
12
|
+
config.expect_with :rspec do |expectations|
|
13
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
14
|
+
# and `failure_message` of custom matchers include text for helper methods
|
15
|
+
# defined using `chain`, e.g.:
|
16
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
17
|
+
# # => "be bigger than 2 and smaller than 4"
|
18
|
+
# ...rather than:
|
19
|
+
# # => "be bigger than 2"
|
20
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
21
|
+
expectations.syntax = :expect
|
22
|
+
end
|
23
|
+
|
24
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
25
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
26
|
+
config.mock_with :rspec do |mocks|
|
27
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
28
|
+
# a real object. This is generally recommended, and will default to
|
29
|
+
# `true` in RSpec 4.
|
30
|
+
mocks.verify_partial_doubles = true
|
31
|
+
end
|
32
|
+
|
33
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
34
|
+
# have no way to turn it off -- the option exists only for backwards
|
35
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
36
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
37
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
38
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
39
|
+
|
40
|
+
# The settings below are suggested to provide a good initial experience
|
41
|
+
# with RSpec, but feel free to customize to your heart's content.
|
42
|
+
|
43
|
+
# This allows you to limit a spec run to individual examples or groups
|
44
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
45
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
46
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
47
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
48
|
+
config.filter_run_when_matching :focus
|
49
|
+
|
50
|
+
# Allows RSpec to persist some state between runs in order to support
|
51
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
52
|
+
# you configure your source control system to ignore this file.
|
53
|
+
config.example_status_persistence_file_path = '.rspec_status'
|
54
|
+
|
55
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
56
|
+
# recommended. For more details, see:
|
57
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
58
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
59
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
60
|
+
config.disable_monkey_patching!
|
61
|
+
|
62
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
63
|
+
# file, and it's useful to allow more verbose output when running an
|
64
|
+
# individual spec file.
|
65
|
+
if config.files_to_run.one?
|
66
|
+
# Use the documentation formatter for detailed output,
|
67
|
+
# unless a formatter has already been configured
|
68
|
+
# (e.g. via a command-line flag).
|
69
|
+
config.default_formatter = 'doc'
|
70
|
+
end
|
71
|
+
|
72
|
+
# Print the 10 slowest examples and example groups at the
|
73
|
+
# end of the spec run, to help surface which specs are running
|
74
|
+
# particularly slow.
|
75
|
+
config.profile_examples = 3
|
76
|
+
|
77
|
+
# Run specs in random order to surface order dependencies. If you find an
|
78
|
+
# order dependency and want to debug it, you can fix the order by providing
|
79
|
+
# the seed, which is printed after each run.
|
80
|
+
# --seed 1234
|
81
|
+
config.order = :random
|
82
|
+
|
83
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
84
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
85
|
+
# test failures related to randomization by passing the same `--seed` value
|
86
|
+
# as the one that triggered the failure.
|
87
|
+
Kernel.srand config.seed
|
88
|
+
end
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kubecontrol
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Marco Adkins
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-12-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '13.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '13.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.17'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.17'
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
- marcoadkins88@gmail.com
|
72
|
+
executables:
|
73
|
+
- console
|
74
|
+
- setup
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- ".github/workflows/gempush.yml"
|
79
|
+
- ".github/workflows/ruby.yml"
|
80
|
+
- ".gitignore"
|
81
|
+
- ".rspec"
|
82
|
+
- CHANGELOG.md
|
83
|
+
- Gemfile
|
84
|
+
- Gemfile.lock
|
85
|
+
- LICENSE
|
86
|
+
- README.md
|
87
|
+
- Rakefile
|
88
|
+
- bin/console
|
89
|
+
- bin/setup
|
90
|
+
- kubecontrol.gemspec
|
91
|
+
- lib/kubecontrol.rb
|
92
|
+
- lib/kubecontrol/client.rb
|
93
|
+
- lib/kubecontrol/pod.rb
|
94
|
+
- lib/kubecontrol/version.rb
|
95
|
+
- spec/kubecontrol/client_spec.rb
|
96
|
+
- spec/kubecontrol/pod_spec.rb
|
97
|
+
- spec/kubecontrol_spec.rb
|
98
|
+
- spec/spec_helper.rb
|
99
|
+
homepage: https://github.com/madkin10/kubecontrol
|
100
|
+
licenses:
|
101
|
+
- MIT
|
102
|
+
metadata:
|
103
|
+
homepage_uri: https://github.com/madkin10/kubecontrol
|
104
|
+
source_code_uri: https://github.com/madkin10/kubecontrol
|
105
|
+
changelog_uri: https://github.com/madkin10/kubecontrol/master/CHANGELOG.md
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
requirements: []
|
121
|
+
rubygems_version: 3.0.3
|
122
|
+
signing_key:
|
123
|
+
specification_version: 4
|
124
|
+
summary: Simple ruby wrapper for `kubectl` commands
|
125
|
+
test_files: []
|