kube_cluster 0.13.0 → 0.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 970ae0c50e86707bbfc361c9d55400538e3e2841b110163fa2499a49a710b972
4
- data.tar.gz: 2d28592acc30a97967e39620db07ed7675ad450b4a199e2c14f8d4dfed3529c6
3
+ metadata.gz: 63baac3449e34445c6737e202f5fbddd0773a6bb4ceb5e839961c8a2a1bf783b
4
+ data.tar.gz: 0db100f62738c946c97bbf7353a3297df0f56c15388744a92527cbadcdb06a8d
5
5
  SHA512:
6
- metadata.gz: f708b01553ec43d5a6cebd7240b6ce8ad3f11a302237c47152984a7f9bd0dea2a2442601a96a38cdc8301811f10feced0fea2953b71e4684eb8932792824bb03
7
- data.tar.gz: 6213f76ec4b1a989502dffd5a34c9ee55788900292e6a30b646750474eb3f99b40830cafffd2c8365ca111260cd73edf52cc4b3595c3e60d81518ee8f40818ef
6
+ metadata.gz: 0dbf476dc0f1d572d0574332d2845f4501d43df1228050267d39122f008e2a2df593ad7827fbf1b65d18d642e69bdb17c572f183af760aab65f12cdcd90eb607
7
+ data.tar.gz: a658aa3a28394eaa6fb50c611a841073484a35fcd50cba01e2772ebede2d86a5ea1a0162330202cc7774665c03bd15a4c8966ae130b8e0b2790ea04ac80cb719
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kube_cluster (0.13.0)
4
+ kube_cluster (0.14.0)
5
5
  activesupport (~> 8.0)
6
6
  kube_kubectl (~> 2.0)
7
7
  kube_schema (~> 1.7)
data/flake.nix CHANGED
@@ -29,7 +29,7 @@
29
29
  ];
30
30
 
31
31
  shellHook = ''
32
- export GEM_HOME="$PWD/.gem"
32
+ export GEM_HOME="$HOME/.gem"
33
33
  export GEM_PATH="$GEM_HOME"
34
34
  export PATH="$GEM_HOME/bin:$PATH"
35
35
  export BUNDLE_PATH="$GEM_HOME"
@@ -19,6 +19,8 @@ module Kube
19
19
  pod_security_context: nil,
20
20
  volume_mounts: {},
21
21
  service_port: nil,
22
+ stdin: false,
23
+ tty: false,
22
24
  &block
23
25
  )
24
26
  @_limits = {}
@@ -56,6 +58,12 @@ module Kube
56
58
  container[:securityContext] = security_context if security_context
57
59
  container[:volumeMounts] = processed_volumes[:volume_mounts] unless processed_volumes[:volume_mounts].empty?
58
60
 
61
+ # Keep stdin/tty open so the pod can be `kubectl attach`-ed for
62
+ # interactive flows (e.g. an OAuth proxy that prompts for a
63
+ # redirect URL on first authorization).
64
+ container[:stdin] = true if stdin
65
+ container[:tty] = true if tty
66
+
59
67
  spec.template.spec.containers = [container]
60
68
  spec.template.spec.initContainers = init_containers unless init_containers.empty?
61
69
  spec.template.spec.volumes = processed_volumes[:volumes] unless processed_volumes[:volumes].empty?
@@ -152,5 +160,20 @@ test do
152
160
  .is_a?(String)
153
161
  .should == true
154
162
  end
163
+
164
+ it "sets stdin/tty on the container when requested" do
165
+ yaml = Kube::Cluster::Standard::DeploymentWithService
166
+ .new(
167
+ name: "interactive",
168
+ image: "ruby/ruby",
169
+ port: 3000,
170
+ stdin: true,
171
+ tty: true,
172
+ )
173
+ .to_yaml
174
+
175
+ yaml.include?("stdin: true").should == true
176
+ yaml.include?("tty: true").should == true
177
+ end
155
178
  end
156
179
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kube
4
4
  module Cluster
5
- VERSION = "0.13.0"
5
+ VERSION = "0.14.0"
6
6
  end
7
7
  end
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: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan K