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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5439cb8e1c5dcc7f1cb319b5523241aaa2a2fbc94e52e03e3316a7c383f435fd
4
- data.tar.gz: 8052cb7358d8b8846d3503dcc586c36b1dae29cc5ab8d4638bcbaf83de29b9a7
3
+ metadata.gz: 037f1db5928b4637acc72c544a813abff1e86c09d20d62496fd752babba2bc52
4
+ data.tar.gz: bd1c9803961947cf117c06cd9fc7a0c68eec31c207277a84a47af3cb513dfd3f
5
5
  SHA512:
6
- metadata.gz: f11d2e8c01f906b1b1f7999db505c3791fcf91496890c3b8a39d1f9660ea04d3d26812942a479a51572f3c27aff1ec8db22e92fe2c059aba5bb7787c8c410cd2
7
- data.tar.gz: f39b6d6878548cdea033d94978f487777b8f7537807e0884463df15d7edf2c47ba472556bff0ac245b1ed547e10ffa6eb88347528609039cd0af454f1177afd4
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kube_cluster (1.1.0)
4
+ kube_cluster (1.2.1)
5
5
  activesupport (~> 8.0)
6
6
  kube_kubectl (~> 2.0)
7
7
  kube_schema (~> 1.9.2)
data/flake.nix CHANGED
@@ -22,6 +22,7 @@
22
22
  ];
23
23
 
24
24
  buildInputs = [
25
+ pkgs.trufflehog
25
26
  ruby
26
27
  pkgs.libyaml # psych gem
27
28
  pkgs.openssl # openssl gem
data/lefthook.yml CHANGED
@@ -1,9 +1,11 @@
1
1
  # Git hooks (managed by lefthook). Install with `bundle exec lefthook install`.
2
2
  #
3
- # Run the full test suite before every commit; a failing test blocks the
4
- # commit. Wrapped in `nix develop --command` because the hook fires outside the
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
- #class Cluster < Kube::Cluster["Cluster"]
11
- #end
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
- #describe "CloudNativePg::Cluster" do
20
- # it "initializes without error" do
21
- # Kube::Cluster::Standard::CloudNativePg::Cluster
22
- # .new()
23
- # .to_yaml
24
- # .is_a?(String)
25
- # .should == true
26
- # end
27
- #end
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kube
4
4
  module Cluster
5
- VERSION = "1.1.0"
5
+ VERSION = "1.2.1"
6
6
  end
7
7
  end
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.
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.1.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan K