kube_cluster 1.0.1 → 1.2.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 +4 -4
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +3 -1
- data/flake.nix +1 -0
- data/kube_cluster.gemspec +1 -0
- data/lefthook.yml +11 -0
- data/lib/kube/cluster/standard/cdi/data_volume.rb +20 -19
- data/lib/kube/cluster/standard/cloud_native_pg/cluster.rb +23 -11
- data/lib/kube/cluster/version.rb +1 -1
- data/lib/kube/cluster.rb +4 -0
- metadata +16 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 037f1db5928b4637acc72c544a813abff1e86c09d20d62496fd752babba2bc52
|
|
4
|
+
data.tar.gz: bd1c9803961947cf117c06cd9fc7a0c68eec31c207277a84a47af3cb513dfd3f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 841bd3e920437edaf8e2abcb1805ceb805166d77596a93b909f9a8ad3ce29284c95bc81f2a93fa81227f2c939d48618cbb4fb95e1114af5944525ce4ef781b97
|
|
7
|
+
data.tar.gz: a8cda216e78e795b13232bcbdc6cd934916989bc2ab6c60de069fad664008fa5bf61d2cd5b09df32708bf53678158180e87e8c230a056b9a7f9de720034a7558
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.1] - 2026-07-13
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `Standard::CloudNativePg::Cluster` — a thin CloudNativePG `Cluster` CR wrapper
|
|
12
|
+
(sets `metadata.name`/`metadata.namespace`; the large, deployment-specific spec
|
|
13
|
+
is supplied via the block).
|
|
14
|
+
|
|
15
|
+
## [1.1.0] - 2026-07-13
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
- `Standard::CDI::DataVolume` — a thin CDI `DataVolume` wrapper (was stubbed
|
|
19
|
+
out), pinned to `cdi.kubevirt.io/v1beta1/DataVolume` in the resolve table.
|
|
20
|
+
- lefthook `pre-commit` hook that runs the full test suite (`bin/test`) before
|
|
21
|
+
every commit; add `lefthook` as a development dependency.
|
|
22
|
+
|
|
8
23
|
## [1.0.1] - 2026-07-13
|
|
9
24
|
|
|
10
25
|
### Added
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
kube_cluster (1.
|
|
4
|
+
kube_cluster (1.2.1)
|
|
5
5
|
activesupport (~> 8.0)
|
|
6
6
|
kube_kubectl (~> 2.0)
|
|
7
7
|
kube_schema (~> 1.9.2)
|
|
@@ -135,6 +135,7 @@ GEM
|
|
|
135
135
|
kube_schema (1.9.2)
|
|
136
136
|
json_schemer (~> 2.5.0)
|
|
137
137
|
rubyshell (~> 1.5.0)
|
|
138
|
+
lefthook (2.1.10)
|
|
138
139
|
localhost (1.8.0)
|
|
139
140
|
bake
|
|
140
141
|
logger (1.7.0)
|
|
@@ -257,6 +258,7 @@ DEPENDENCIES
|
|
|
257
258
|
bake-modernize
|
|
258
259
|
bake-releases
|
|
259
260
|
kube_cluster!
|
|
261
|
+
lefthook (~> 2.1)
|
|
260
262
|
rake (~> 13.0)
|
|
261
263
|
scampi (~> 1.0)
|
|
262
264
|
utopia-project
|
data/flake.nix
CHANGED
data/kube_cluster.gemspec
CHANGED
|
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
|
30
30
|
|
|
31
31
|
spec.add_development_dependency "rake", "~> 13.0"
|
|
32
32
|
spec.add_development_dependency "scampi", "~> 1.0"
|
|
33
|
+
spec.add_development_dependency "lefthook", "~> 2.1"
|
|
33
34
|
|
|
34
35
|
spec.add_dependency "kube_schema", "~> 1.9.2"
|
|
35
36
|
spec.add_dependency "kube_kubectl", "~> 2.0"
|
data/lefthook.yml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Git hooks (managed by lefthook). Install with `bundle exec lefthook install`.
|
|
2
|
+
#
|
|
3
|
+
# pre-commit: scan for secrets (trufflehog) and run the test suite (bin/test).
|
|
4
|
+
# Both are wrapped in `nix develop --command` because the hook fires outside the
|
|
5
|
+
# flake devshell, so trufflehog / bundler / scampi wouldn't otherwise be on PATH.
|
|
6
|
+
pre-commit:
|
|
7
|
+
commands:
|
|
8
|
+
secrets:
|
|
9
|
+
run: nix develop --command trufflehog git file://. --since-commit HEAD --only-verified --fail
|
|
10
|
+
tests:
|
|
11
|
+
run: nix develop --command bin/test
|
|
@@ -7,14 +7,14 @@ module Kube
|
|
|
7
7
|
module Cluster
|
|
8
8
|
module Standard
|
|
9
9
|
module CDI
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
class DataVolume < Kube::Cluster['DataVolume']
|
|
11
|
+
def initialize(name:, &block)
|
|
12
|
+
super() {
|
|
13
|
+
metadata.name = name
|
|
14
|
+
instance_exec(&block) if block
|
|
15
|
+
}
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -22,14 +22,15 @@ end
|
|
|
22
22
|
|
|
23
23
|
__END__
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
describe "CDI::DataVolume" do
|
|
26
|
+
it "initializes without error" do
|
|
27
|
+
Kube::Cluster::Standard::CDI::DataVolume
|
|
28
|
+
.new(name: "my-example-volume") {
|
|
29
|
+
spec.source.blank = {}
|
|
30
|
+
spec.storage.resources = { requests: { storage: "1Gi" } }
|
|
31
|
+
}
|
|
32
|
+
.to_yaml
|
|
33
|
+
.is_a?(String)
|
|
34
|
+
.should == true
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -7,8 +7,17 @@ module Kube
|
|
|
7
7
|
module Cluster
|
|
8
8
|
module Standard
|
|
9
9
|
module CloudNativePg
|
|
10
|
-
#
|
|
11
|
-
#
|
|
10
|
+
# A CloudNativePG Cluster CR. Thin wrapper: sets metadata, leaves the
|
|
11
|
+
# (large, deployment-specific) spec to the block.
|
|
12
|
+
class Cluster < Kube::Cluster["Cluster"]
|
|
13
|
+
def initialize(name: "postgres", namespace: nil, &block)
|
|
14
|
+
super() {
|
|
15
|
+
metadata.name = name
|
|
16
|
+
metadata.namespace = namespace if namespace
|
|
17
|
+
instance_exec(&block) if block
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
12
21
|
end
|
|
13
22
|
end
|
|
14
23
|
end
|
|
@@ -16,12 +25,15 @@ end
|
|
|
16
25
|
|
|
17
26
|
__END__
|
|
18
27
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
describe "CloudNativePg::Cluster" do
|
|
29
|
+
it "initializes without error" do
|
|
30
|
+
Kube::Cluster::Standard::CloudNativePg::Cluster
|
|
31
|
+
.new(name: "postgres", namespace: "cloudnative-pg") {
|
|
32
|
+
spec.instances = 1
|
|
33
|
+
spec.storage = { size: "1Gi" }
|
|
34
|
+
}
|
|
35
|
+
.to_yaml
|
|
36
|
+
.is_a?(String)
|
|
37
|
+
.should == true
|
|
38
|
+
end
|
|
39
|
+
end
|
data/lib/kube/cluster/version.rb
CHANGED
data/lib/kube/cluster.rb
CHANGED
|
@@ -109,6 +109,7 @@ Kube::Cluster.config do
|
|
|
109
109
|
resolve "DecoratorController", to: "metacontroller.k8s.io/v1alpha1/DecoratorController"
|
|
110
110
|
|
|
111
111
|
# CloudNativePG.
|
|
112
|
+
resolve "Cluster", to: "postgresql.cnpg.io/v1/Cluster"
|
|
112
113
|
resolve "Database", to: "postgresql.cnpg.io/v1/Database"
|
|
113
114
|
|
|
114
115
|
# External Secrets Operator.
|
|
@@ -117,6 +118,9 @@ Kube::Cluster.config do
|
|
|
117
118
|
# KubeVirt.
|
|
118
119
|
resolve "VirtualMachine", to: "kubevirt.io/v1/VirtualMachine"
|
|
119
120
|
|
|
121
|
+
# CDI (Containerized Data Importer).
|
|
122
|
+
resolve "DataVolume", to: "cdi.kubevirt.io/v1beta1/DataVolume"
|
|
123
|
+
|
|
120
124
|
# k3s HelmChart.
|
|
121
125
|
resolve "HelmChart", to: "helm.cattle.io/v1/HelmChart"
|
|
122
126
|
|
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: 1.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan K
|
|
@@ -37,6 +37,20 @@ dependencies:
|
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: '1.0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: lefthook
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '2.1'
|
|
47
|
+
type: :development
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '2.1'
|
|
40
54
|
- !ruby/object:Gem::Dependency
|
|
41
55
|
name: kube_schema
|
|
42
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -173,6 +187,7 @@ files:
|
|
|
173
187
|
- guides/middleware/readme.md
|
|
174
188
|
- guides/resources/readme.md
|
|
175
189
|
- kube_cluster.gemspec
|
|
190
|
+
- lefthook.yml
|
|
176
191
|
- lib/kube/cli/cluster.rb
|
|
177
192
|
- lib/kube/cluster.rb
|
|
178
193
|
- lib/kube/cluster/connection.rb
|