kube_cluster 1.7.0 → 1.9.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/CHANGELOG.md +46 -0
- data/Gemfile.lock +3 -3
- data/flake.lock +42 -5
- data/flake.nix +11 -11
- data/gemset.nix +1008 -0
- data/kube_cluster.gemspec +1 -1
- data/lib/kube/cluster/middleware/set_namespace.rb +83 -14
- data/lib/kube/cluster/standard/cluster_role.rb +69 -0
- data/lib/kube/cluster/standard/cluster_role_binding.rb +56 -0
- data/lib/kube/cluster/standard/rbac_rules.rb +111 -0
- data/lib/kube/cluster/standard/role.rb +6 -11
- data/lib/kube/cluster/version.rb +1 -1
- data/lib/kube/cluster.rb +2 -0
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2597321a575128ac29f8ef080595e150dab2d37bdf55562d75de3c252ab785a3
|
|
4
|
+
data.tar.gz: 2513bd35ac124e04f574f3ecab461288c6989a474a48dbe517962f8e26a35275
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ff84fb925d204f79a3bda56f5831df808e67d477b25f98d2cace2e9bee9dc868246ac613e98c9b8dca976bd6b31a80618b1da89bd52b40f8fccd0ee842d55a8
|
|
7
|
+
data.tar.gz: a937837dce0b8ca84e5f3a092adeee6388239cfeccf4f767f2dc2b1f57c402bf388f1a1c6efbfa40817d1ec75ebb5246d921a97b3e871b3822e52a1b34d0a8d1
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,52 @@ 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.9.0] - 2026-09-28
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Ruby pattern matching for resources and manifests, inherited from
|
|
12
|
+
kube_schema 1.12.0 (`Resource#deconstruct_keys`, `Manifest#deconstruct`):
|
|
13
|
+
|
|
14
|
+
deployment => {metadata: {name:, namespace:}}
|
|
15
|
+
|
|
16
|
+
Deployment = Kube::Cluster["Deployment"]
|
|
17
|
+
manifest => [Deployment => dep, *rest]
|
|
18
|
+
|
|
19
|
+
`Kube::Cluster["Deployment"]` cannot be written inline in a pattern — Ruby
|
|
20
|
+
parses `Const[...]` as array-pattern syntax, not a method call. Assign the
|
|
21
|
+
class to a constant, or pin the expression:
|
|
22
|
+
`^(Kube::Cluster["Deployment"])`.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- Requires kube_schema `~> 1.12.0`.
|
|
26
|
+
|
|
27
|
+
## [1.8.0] - 2026-09-17
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- `Standard::RbacRules` — the rules-shorthand builder behind
|
|
31
|
+
`Standard::Role`, now a shared module. The spec grammar handles
|
|
32
|
+
`"resource"`, `"resource/subresource"`, `"group/resource"` and
|
|
33
|
+
`"group/resource/subresource"`: the first segment is an API group when
|
|
34
|
+
`Kube::Schema.api_groups` knows it (`batch`, `apps`, `argoproj.io`, ...) or
|
|
35
|
+
when it contains a dot (API groups are DNS subdomains, which covers CRD
|
|
36
|
+
groups no schema has registered). Verbs are stringified, so symbols work.
|
|
37
|
+
- `Standard::ClusterRole` — the rules shorthand, cluster-wide.
|
|
38
|
+
- `Standard::ClusterRoleBinding` — wires a ClusterRole to a ServiceAccount,
|
|
39
|
+
mirroring `Standard::RoleBinding`.
|
|
40
|
+
- `Middleware::SetNamespace` now fills blank ServiceAccount subject
|
|
41
|
+
namespaces on ClusterRoleBinding as well as RoleBinding. ClusterRoleBinding
|
|
42
|
+
is cluster-scoped, so there is no metadata.namespace to copy from — the
|
|
43
|
+
middleware fills the subjects directly.
|
|
44
|
+
- `ClusterRole` and `ClusterRoleBinding` pinned in the resolve table.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- Requires kube_schema `~> 1.11.0` for `Kube::Schema.api_groups`.
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
- The rules shorthand parsed `"pods/exec"` as `apiGroups: ["pods"],
|
|
51
|
+
resources: ["exec"]` — a rule matching nothing. Core subresources now
|
|
52
|
+
render as `apiGroups: [""], resources: ["pods/exec"]`.
|
|
53
|
+
|
|
8
54
|
## [1.7.0] - 2026-09-17
|
|
9
55
|
|
|
10
56
|
### Added
|
data/Gemfile.lock
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
kube_cluster (1.
|
|
4
|
+
kube_cluster (1.8.0)
|
|
5
5
|
activesupport (~> 8.0)
|
|
6
6
|
kube_kubectl (~> 2.0)
|
|
7
|
-
kube_schema (~> 1.
|
|
7
|
+
kube_schema (~> 1.11.0)
|
|
8
8
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
@@ -132,7 +132,7 @@ GEM
|
|
|
132
132
|
rubyshell (~> 1.5)
|
|
133
133
|
shellwords (~> 0.2.2)
|
|
134
134
|
string_builder (~> 1.2.2)
|
|
135
|
-
kube_schema (1.
|
|
135
|
+
kube_schema (1.11.0)
|
|
136
136
|
json_schemer (~> 2.5.0)
|
|
137
137
|
rubyshell (~> 1.5.0)
|
|
138
138
|
lefthook (2.1.10)
|
data/flake.lock
CHANGED
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"nodes": {
|
|
3
|
+
"mine": {
|
|
4
|
+
"inputs": {
|
|
5
|
+
"nixpkgs": [
|
|
6
|
+
"nixpkgs"
|
|
7
|
+
],
|
|
8
|
+
"systems": "systems"
|
|
9
|
+
},
|
|
10
|
+
"locked": {
|
|
11
|
+
"lastModified": 1790556091,
|
|
12
|
+
"narHash": "sha256-+kgvg6vuaxjEUUad6pL+pxa3LZFveq3XvWGSZ+Z9gOA=",
|
|
13
|
+
"owner": "n-at-han-k",
|
|
14
|
+
"repo": "flake.nix",
|
|
15
|
+
"rev": "d023f40398596a5d80bf03e429c678a99b3f259a",
|
|
16
|
+
"type": "github"
|
|
17
|
+
},
|
|
18
|
+
"original": {
|
|
19
|
+
"owner": "n-at-han-k",
|
|
20
|
+
"repo": "flake.nix",
|
|
21
|
+
"type": "github"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
3
24
|
"nixpkgs": {
|
|
4
25
|
"locked": {
|
|
5
|
-
"lastModified":
|
|
6
|
-
"narHash": "sha256-
|
|
26
|
+
"lastModified": 1780902259,
|
|
27
|
+
"narHash": "sha256-q8yYEC5f1mFlQO9RGna4LTc9QrcvWunX6FYp83munkQ=",
|
|
7
28
|
"owner": "NixOS",
|
|
8
29
|
"repo": "nixpkgs",
|
|
9
|
-
"rev": "
|
|
30
|
+
"rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca",
|
|
10
31
|
"type": "github"
|
|
11
32
|
},
|
|
12
33
|
"original": {
|
|
13
34
|
"owner": "NixOS",
|
|
14
|
-
"ref": "nixos-unstable",
|
|
15
35
|
"repo": "nixpkgs",
|
|
36
|
+
"rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca",
|
|
16
37
|
"type": "github"
|
|
17
38
|
}
|
|
18
39
|
},
|
|
19
40
|
"root": {
|
|
20
41
|
"inputs": {
|
|
42
|
+
"mine": "mine",
|
|
21
43
|
"nixpkgs": "nixpkgs",
|
|
22
44
|
"utils": "utils"
|
|
23
45
|
}
|
|
@@ -37,9 +59,24 @@
|
|
|
37
59
|
"type": "github"
|
|
38
60
|
}
|
|
39
61
|
},
|
|
62
|
+
"systems_2": {
|
|
63
|
+
"locked": {
|
|
64
|
+
"lastModified": 1681028828,
|
|
65
|
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
66
|
+
"owner": "nix-systems",
|
|
67
|
+
"repo": "default",
|
|
68
|
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
69
|
+
"type": "github"
|
|
70
|
+
},
|
|
71
|
+
"original": {
|
|
72
|
+
"owner": "nix-systems",
|
|
73
|
+
"repo": "default",
|
|
74
|
+
"type": "github"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
40
77
|
"utils": {
|
|
41
78
|
"inputs": {
|
|
42
|
-
"systems": "
|
|
79
|
+
"systems": "systems_2"
|
|
43
80
|
},
|
|
44
81
|
"locked": {
|
|
45
82
|
"lastModified": 1731533236,
|
data/flake.nix
CHANGED
|
@@ -2,30 +2,31 @@
|
|
|
2
2
|
description = "Ruby gem flake";
|
|
3
3
|
|
|
4
4
|
inputs = {
|
|
5
|
-
nixpkgs.url = "github:NixOS/nixpkgs/
|
|
5
|
+
nixpkgs.url = "github:NixOS/nixpkgs/bd0ff2d3eac24699c3664d5966b9ef36f388e2ca"; # == this machine's system nixpkgs
|
|
6
6
|
utils.url = "github:numtide/flake-utils";
|
|
7
|
+
mine.url = "github:n-at-han-k/flake.nix";
|
|
8
|
+
mine.inputs.nixpkgs.follows = "nixpkgs";
|
|
7
9
|
};
|
|
8
|
-
outputs = { self, nixpkgs, utils }:
|
|
10
|
+
outputs = { self, nixpkgs, utils, mine }:
|
|
9
11
|
utils.lib.eachDefaultSystem (system:
|
|
10
12
|
let
|
|
13
|
+
# No mine.overlays.default: it overrides pkg-config, which stdenv
|
|
14
|
+
# splices, so the overlay rebuilds stdenv and all of nixpkgs from
|
|
15
|
+
# source. mine.inputs.nixpkgs.follows makes it redundant anyway.
|
|
11
16
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
12
|
-
ruby = pkgs.ruby_3_4;
|
|
17
|
+
ruby = pkgs.ruby_3_4;
|
|
13
18
|
kubectlWithKubeconfig = pkgs.writeShellScriptBin "kubectl" ''
|
|
14
19
|
#!${pkgs.bash}/bin/bash
|
|
15
20
|
KUBECONFIG="$PWD/kubeconfig.yaml" ${pkgs.kubectl}/bin/kubectl "$@"
|
|
16
21
|
'';
|
|
17
22
|
in
|
|
18
23
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
+
# pkg-config, bundix, libyaml, openssl, overmind, tmux and `bundix -l`
|
|
25
|
+
# come from mkRubyShell.
|
|
26
|
+
devShells.default = mine.lib.${system}.mkRubyShell {
|
|
24
27
|
buildInputs = [
|
|
25
28
|
pkgs.trufflehog
|
|
26
29
|
ruby
|
|
27
|
-
pkgs.libyaml # psych gem
|
|
28
|
-
pkgs.openssl # openssl gem
|
|
29
30
|
kubectlWithKubeconfig
|
|
30
31
|
];
|
|
31
32
|
|
|
@@ -42,4 +43,3 @@
|
|
|
42
43
|
}
|
|
43
44
|
);
|
|
44
45
|
}
|
|
45
|
-
|