pfab 0.49.0 → 0.51.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: 2f1a84c3c63d1db81cc363286650c690eab5759533679a74d0dc1849368204f6
4
- data.tar.gz: fec0e7d30e078a426b4596ae0ea7dface693f5b4f994c9cd26c9e63eb9f9b086
3
+ metadata.gz: c2ffa684bec7e96dac9c896b6f037f02e9c73e2c9c2943c47fc400c59c0d490d
4
+ data.tar.gz: a69b88c63cdc12a417c2ed80373c69b31ba5662c412efa6131dfc51168b2b7fa
5
5
  SHA512:
6
- metadata.gz: 644d664ff9952cc3f485b19b0c188f6b608547e9b42af3a2975392a0c80a83df6f6c754d637a023a725b0e2eec56d96334a0c0ee76d6bff409ca8feeef72deb2
7
- data.tar.gz: 6c002bd38ff2975392daa54845aa2333a18e5fff14e0d1c51001415aae9724cca5eb7f00630c0e81e7b717c24f1273edc43cdd961a18359a6a7ca069ef3f9582
6
+ metadata.gz: 24b51d55f108f38c95b6ae05a46104353033240a10a18481dafc56185377e9ae66735dc99f3c29276067bb361e16efa376dda5b05e7e33ff1e1abdbad0bf6429
7
+ data.tar.gz: 361531b33dfec0ce581c53d7049d6142792d4264a76a975f252c590ce0aee973412196edbdd3972c6c800fdd6176c1dc968abd6817524b59a65e38fcb9fdf284
data/lib/pfab/cli.rb CHANGED
@@ -106,18 +106,20 @@ module Pfab
106
106
 
107
107
  command :exec do |c|
108
108
  c.option "-c", "--command command", "use with exec to run a command and exit. default is /bin/sh"
109
- c.syntax = "pfab exec"
109
+ c.syntax = "pfab exec [-- command to execute]'"
110
110
  c.summary = "kubectl exec into a pod"
111
111
  c.description = "CLI to the Cloud"
112
112
  c.example "exec into the first pod in staging",
113
- "pfab exec"
113
+ "pfab -e staging exec"
114
114
  c.example "exec into the first pod in production",
115
- "ezp -p exec"
115
+ "pfab -p exec"
116
116
  c.action do |args, options|
117
117
  set_kube_context
118
+ # Access the command line input after "--"
119
+ additional_args = ARGV[ARGV.index('--') + 1..-1] if ARGV.include?('--')
118
120
  app_name = get_app_name
119
121
  first_pod = get_first_pod app_name
120
- kubectl "exec -it #{first_pod}", "-- #{options.command || '/bin/sh'}"
122
+ kubectl "exec -it #{first_pod}", "-- #{additional_args.join(" ") || options.command || '/bin/sh'}"
121
123
  end
122
124
  end
123
125
 
@@ -125,6 +125,28 @@ module Pfab
125
125
  } }
126
126
  end
127
127
  end
128
+
129
+
130
+ def container_ports
131
+ ports = []
132
+ if app_vars["port"]
133
+ ports.append ({
134
+ name: "main",
135
+ containerPort: app_vars["port"]
136
+ })
137
+ end
138
+ %w[additionalPorts containerPorts].each do |key|
139
+ if get(key)
140
+ get(key).each do |name, number|
141
+ ports.append(
142
+ {name: name, containerPort: number}
143
+ )
144
+ end
145
+ end
146
+ end
147
+
148
+ return ports
149
+ end
128
150
  end
129
151
  end
130
152
  end
@@ -58,6 +58,7 @@ module Pfab
58
58
  env: env_vars,
59
59
  envFrom: env_from,
60
60
  resources: resources,
61
+ ports: container_ports()
61
62
  }
62
63
  ]
63
64
  }.compact,
@@ -251,17 +251,7 @@ module Pfab
251
251
  readOnly: true
252
252
  )
253
253
  end
254
- ports = [ {
255
- name: "main",
256
- containerPort: app_vars["port"]
257
- }]
258
- if get("additionalPorts")
259
- get("additionalPorts").each do |name, number|
260
- ports.append(
261
- {name: name, containerPort: number}
262
- )
263
- end
264
- end
254
+ ports = container_ports()
265
255
 
266
256
  {
267
257
  kind: "Deployment",
data/lib/pfab/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Pfab
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 49
4
+ MINOR = 51
5
5
  PATCH = 0
6
6
  BUILD = nil
7
7
 
data/pfab.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: pfab 0.49.0 ruby lib
5
+ # stub: pfab 0.51.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "pfab".freeze
9
- s.version = "0.49.0"
9
+ s.version = "0.51.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Jeff Dwyer".freeze]
14
- s.date = "2024-03-01"
14
+ s.date = "2024-05-13"
15
15
  s.description = "k8s helper".freeze
16
16
  s.email = "jdwyer@prefab.cloud".freeze
17
17
  s.executables = ["pfab".freeze]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.0
4
+ version: 0.51.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-01 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander