kube_cluster 1.1.0 → 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 +7 -0
- data/Gemfile.lock +1 -1
- data/flake.nix +1 -0
- data/lefthook.yml +5 -3
- 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 +1 -0
- metadata +1 -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,13 @@ 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
|
+
|
|
8
15
|
## [1.1.0] - 2026-07-13
|
|
9
16
|
|
|
10
17
|
### Added
|
data/Gemfile.lock
CHANGED
data/flake.nix
CHANGED
data/lefthook.yml
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# Git hooks (managed by lefthook). Install with `bundle exec lefthook install`.
|
|
2
2
|
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# flake devshell, so bundler/scampi wouldn't otherwise be on PATH.
|
|
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
6
|
pre-commit:
|
|
7
7
|
commands:
|
|
8
|
+
secrets:
|
|
9
|
+
run: nix develop --command trufflehog git file://. --since-commit HEAD --only-verified --fail
|
|
8
10
|
tests:
|
|
9
11
|
run: nix develop --command bin/test
|
|
@@ -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.
|