kube_cluster 1.9.0 → 2.0.0
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/.envrc +2 -0
- data/.github/FUNDING.yml +3 -0
- data/.rubocop.yml +226 -5984
- data/CHANGELOG.md +26 -0
- data/Gemfile +13 -1
- data/Gemfile.lock +44 -14
- data/bin/rubocop +3 -0
- data/cops/begin_block_assignment.rb +34 -0
- data/cops/comment_structure.rb +307 -0
- data/cops/constant_matches_path.rb +142 -0
- data/cops/multiline_method_arguments.rb +89 -0
- data/cops/no_conditional_assignment.rb +186 -0
- data/cops/no_console_logging.rb +62 -0
- data/cops/no_modifier_if.rb +74 -0
- data/cops/no_return.rb +152 -0
- data/cops/support/prism_source.rb +234 -0
- data/cops/use_tap.rb +100 -0
- data/flake.lock +3 -3
- data/flake.nix +22 -21
- data/gemset.nix +164 -19
- data/kube_cluster.gemspec +3 -2
- data/lib/kube/cluster.rb +1 -1
- data/lib/kube/helm/chart.rb +12 -1
- data/lib/{kube/cluster → kube_cluster}/version.rb +1 -1
- data/lib/kube_cluster.rb +3 -0
- metadata +31 -8
- data/bin/increment-version +0 -45
- data/bin/release-gem +0 -32
- data/bin/tag-version +0 -19
- data/lib/kube/cluster/version.rb.erb +0 -7
data/kube_cluster.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "lib/
|
|
3
|
+
require_relative "lib/kube_cluster/version"
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "kube_cluster"
|
|
@@ -28,11 +28,12 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
29
29
|
spec.require_paths = ["lib"]
|
|
30
30
|
|
|
31
|
+
spec.add_development_dependency "gem_kit-release", "~> 0.3"
|
|
31
32
|
spec.add_development_dependency "rake", "~> 13.0"
|
|
32
33
|
spec.add_development_dependency "scampi", "~> 1.0"
|
|
33
34
|
spec.add_development_dependency "lefthook", "~> 2.1"
|
|
34
35
|
|
|
35
|
-
spec.add_dependency "kube_schema", "~>
|
|
36
|
+
spec.add_dependency "kube_schema", "~> 2.0"
|
|
36
37
|
spec.add_dependency "kube_kubectl", "~> 2.0"
|
|
37
38
|
spec.add_dependency "activesupport", "~> 8.0"
|
|
38
39
|
end
|
data/lib/kube/cluster.rb
CHANGED
|
@@ -5,7 +5,7 @@ require "kube/schema"
|
|
|
5
5
|
require "active_support/core_ext/string/inflections"
|
|
6
6
|
|
|
7
7
|
require_relative "../kube/errors"
|
|
8
|
-
require_relative "
|
|
8
|
+
require_relative "../kube_cluster/version"
|
|
9
9
|
require_relative "cluster/script_command"
|
|
10
10
|
require 'kube/ctl'
|
|
11
11
|
require_relative 'helm/repo'
|
data/lib/kube/helm/chart.rb
CHANGED
|
@@ -161,12 +161,23 @@ module Kube
|
|
|
161
161
|
def parse_crds(yaml_output)
|
|
162
162
|
return [] if yaml_output.nil? || yaml_output.strip.empty?
|
|
163
163
|
|
|
164
|
-
docs = YAML.safe_load_stream(yaml_output, permitted_classes: [Symbol])
|
|
164
|
+
docs = YAML.safe_load_stream(split_documents(yaml_output), permitted_classes: [Symbol])
|
|
165
165
|
docs.compact
|
|
166
166
|
.select { |doc| doc.is_a?(Hash) && doc["kind"] == "CustomResourceDefinition" }
|
|
167
167
|
.map { |doc| Kube::Cluster["CustomResourceDefinition"].new(doc) }
|
|
168
168
|
end
|
|
169
169
|
|
|
170
|
+
# `helm show crds` concatenates the chart's crds/*.yaml WITHOUT a `---`
|
|
171
|
+
# between them, so a chart shipping several CRDs arrives as one document
|
|
172
|
+
# with duplicate top-level keys -- and every CRD but the last is lost
|
|
173
|
+
# silently. external-dns 1.22.0 ships dnsendpoints and dnsrecords that
|
|
174
|
+
# way, and only dnsrecords survived. Start a document at every top-level
|
|
175
|
+
# `apiVersion:`; a file that already carries its own `---` yields an
|
|
176
|
+
# empty document, which the caller compacts away.
|
|
177
|
+
def split_documents(yaml_output)
|
|
178
|
+
yaml_output.gsub(/\n(?=apiVersion:)/, "\n---\n")
|
|
179
|
+
end
|
|
180
|
+
|
|
170
181
|
# The chart source for helm commands — either a local path or a remote ref.
|
|
171
182
|
def source
|
|
172
183
|
@path || @ref
|
data/lib/kube_cluster.rb
ADDED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kube_cluster
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan K
|
|
@@ -9,6 +9,20 @@ bindir: exe
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-01 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: gem_kit-release
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0.3'
|
|
19
|
+
type: :development
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0.3'
|
|
12
26
|
- !ruby/object:Gem::Dependency
|
|
13
27
|
name: rake
|
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -57,14 +71,14 @@ dependencies:
|
|
|
57
71
|
requirements:
|
|
58
72
|
- - "~>"
|
|
59
73
|
- !ruby/object:Gem::Version
|
|
60
|
-
version:
|
|
74
|
+
version: '2.0'
|
|
61
75
|
type: :runtime
|
|
62
76
|
prerelease: false
|
|
63
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
78
|
requirements:
|
|
65
79
|
- - "~>"
|
|
66
80
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
81
|
+
version: '2.0'
|
|
68
82
|
- !ruby/object:Gem::Dependency
|
|
69
83
|
name: kube_kubectl
|
|
70
84
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -104,6 +118,7 @@ extensions: []
|
|
|
104
118
|
extra_rdoc_files: []
|
|
105
119
|
files:
|
|
106
120
|
- ".envrc"
|
|
121
|
+
- ".github/FUNDING.yml"
|
|
107
122
|
- ".github/workflows/gh-pages.yml"
|
|
108
123
|
- ".github/workflows/release.yml"
|
|
109
124
|
- ".github/workflows/tag-gem-version-bump.yml"
|
|
@@ -117,11 +132,19 @@ files:
|
|
|
117
132
|
- Rakefile
|
|
118
133
|
- bin/console
|
|
119
134
|
- bin/dev
|
|
120
|
-
- bin/
|
|
121
|
-
- bin/release-gem
|
|
135
|
+
- bin/rubocop
|
|
122
136
|
- bin/setup
|
|
123
|
-
- bin/tag-version
|
|
124
137
|
- bin/test
|
|
138
|
+
- cops/begin_block_assignment.rb
|
|
139
|
+
- cops/comment_structure.rb
|
|
140
|
+
- cops/constant_matches_path.rb
|
|
141
|
+
- cops/multiline_method_arguments.rb
|
|
142
|
+
- cops/no_conditional_assignment.rb
|
|
143
|
+
- cops/no_console_logging.rb
|
|
144
|
+
- cops/no_modifier_if.rb
|
|
145
|
+
- cops/no_return.rb
|
|
146
|
+
- cops/support/prism_source.rb
|
|
147
|
+
- cops/use_tap.rb
|
|
125
148
|
- docker-compose.yml
|
|
126
149
|
- examples/01-basic-redis-pod/Gemfile
|
|
127
150
|
- examples/01-basic-redis-pod/README.md
|
|
@@ -274,12 +297,12 @@ files:
|
|
|
274
297
|
- lib/kube/cluster/standard/victoria_metrics/vt_cluster.rb
|
|
275
298
|
- lib/kube/cluster/standard/victoria_metrics/vt_single.rb
|
|
276
299
|
- lib/kube/cluster/standard/volume_processing.rb
|
|
277
|
-
- lib/kube/cluster/version.rb
|
|
278
|
-
- lib/kube/cluster/version.rb.erb
|
|
279
300
|
- lib/kube/errors.rb
|
|
280
301
|
- lib/kube/helm/chart.rb
|
|
281
302
|
- lib/kube/helm/endpoint.rb
|
|
282
303
|
- lib/kube/helm/repo.rb
|
|
304
|
+
- lib/kube_cluster.rb
|
|
305
|
+
- lib/kube_cluster/version.rb
|
|
283
306
|
- readme.md
|
|
284
307
|
homepage: https://github.com/general-intelligence-systems/kube_cluster
|
|
285
308
|
licenses:
|
data/bin/increment-version
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require "erb"
|
|
5
|
-
require_relative "../lib/kube/cluster/version"
|
|
6
|
-
|
|
7
|
-
USAGE = <<~TEXT
|
|
8
|
-
Usage: bin/increment-version <major|minor|patch>
|
|
9
|
-
TEXT
|
|
10
|
-
|
|
11
|
-
segment = ARGV[0]
|
|
12
|
-
|
|
13
|
-
unless %w[major minor patch].include?(segment)
|
|
14
|
-
warn USAGE
|
|
15
|
-
exit 1
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
current = Kube::Cluster::VERSION
|
|
19
|
-
major, minor, patch = current.split(".").map(&:to_i)
|
|
20
|
-
|
|
21
|
-
case segment
|
|
22
|
-
when "major"
|
|
23
|
-
major += 1
|
|
24
|
-
minor = 0
|
|
25
|
-
patch = 0
|
|
26
|
-
when "minor"
|
|
27
|
-
minor += 1
|
|
28
|
-
patch = 0
|
|
29
|
-
when "patch"
|
|
30
|
-
patch += 1
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
version = "#{major}.#{minor}.#{patch}"
|
|
34
|
-
|
|
35
|
-
template_path = File.expand_path("../lib/kube/cluster/version.rb.erb", __dir__)
|
|
36
|
-
output_path = File.expand_path("../lib/kube/cluster/version.rb", __dir__)
|
|
37
|
-
|
|
38
|
-
template = ERB.new(File.read(template_path))
|
|
39
|
-
result = template.result(binding)
|
|
40
|
-
|
|
41
|
-
File.write(output_path, result)
|
|
42
|
-
|
|
43
|
-
`bundle install`
|
|
44
|
-
|
|
45
|
-
puts "#{current} -> #{version}"
|
data/bin/release-gem
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require_relative "../lib/kube/cluster/version"
|
|
5
|
-
|
|
6
|
-
local_version = Kube::Cluster::VERSION
|
|
7
|
-
gem_name = "kube_cluster"
|
|
8
|
-
gemspec = "kube_cluster.gemspec"
|
|
9
|
-
|
|
10
|
-
puts "Local version: #{local_version}"
|
|
11
|
-
|
|
12
|
-
remote_output = `gem specification #{gem_name} version --remote 2>&1`
|
|
13
|
-
|
|
14
|
-
if $?.success?
|
|
15
|
-
remote_version = remote_output[/version: (.+)/, 1]&.strip
|
|
16
|
-
puts "Remote version: #{remote_version}"
|
|
17
|
-
|
|
18
|
-
if Gem::Version.new(local_version) <= Gem::Version.new(remote_version)
|
|
19
|
-
abort "ERROR: Local version (#{local_version}) has not been incremented past remote (#{remote_version})"
|
|
20
|
-
end
|
|
21
|
-
else
|
|
22
|
-
puts "Gem not yet published remotely, proceeding with first release"
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
puts "Building #{gemspec}..."
|
|
26
|
-
system("gem build #{gemspec}") || abort("ERROR: gem build failed")
|
|
27
|
-
|
|
28
|
-
gem_file = "#{gem_name}-#{local_version}.gem"
|
|
29
|
-
puts "Pushing #{gem_file}..."
|
|
30
|
-
system("gem push #{gem_file}") || abort("ERROR: gem push failed")
|
|
31
|
-
|
|
32
|
-
puts "Released #{gem_name} #{local_version}"
|
data/bin/tag-version
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require_relative "../lib/kube/cluster/version"
|
|
5
|
-
|
|
6
|
-
version = Kube::Cluster::VERSION
|
|
7
|
-
tag = "v#{version}"
|
|
8
|
-
|
|
9
|
-
existing = `git tag -l #{tag}`.strip
|
|
10
|
-
unless existing.empty?
|
|
11
|
-
abort "ERROR: Tag #{tag} already exists"
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
system("git tag #{tag}") || abort("ERROR: Failed to create tag #{tag}")
|
|
15
|
-
|
|
16
|
-
puts "Tagged #{tag}"
|
|
17
|
-
puts ""
|
|
18
|
-
puts "To push the tag, run:"
|
|
19
|
-
puts " git push --tags"
|