kuber_kit 0.8.7 → 0.8.8

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: 54b6ecd710d6c26abfa3120d45ee37c4c48591279399f7dc7283ed280484e469
4
- data.tar.gz: 18402da273d9994f2933469e84138f3ad262b3315126a6578e86a8d742b505af
3
+ metadata.gz: 2d30438270f3b2b82520081fc47903c6a19fdf916369bb238a387bc99b8fa7ab
4
+ data.tar.gz: 661c969777f171ead96170c795f04d4cce93989eec75de7a89bf65f8e4711e62
5
5
  SHA512:
6
- metadata.gz: c3b25ccf45339aada7b5a4bd03593b95aac04daf85ebd65789a3a8670b31286be1445cf6b4c4b42b12e076c08b7df46660bb0d6655acdadc50fb8806d9aa8e0a
7
- data.tar.gz: c19d7bbd25d912d0c8cb786fb0e5ef947887a9f27eb9866a609bd3aa96dfaf4b31120001da3b72f4d4808bf52dc78a3998f0746b602eff8c02fa17336695e9c9
6
+ metadata.gz: 7db454d99455a028a8a235efb4873ea199f38800e818e868d54dc29626ab2694f73e4264a3ec61aa5a355e1b4aaeebabf17fee92efb9e630407dacb004513ee9
7
+ data.tar.gz: 00412d664f4beb3ae004a04b916dc75bb7d7284a1a4c8add1a283f2039953fdcd4e84e219432e6fde1fe3a1111af54eec07cdc9b8671b59f9c501dd1dd12ce9c
data/CHANGELOG.md CHANGED
@@ -1,8 +1,7 @@
1
- **0.8.5**
2
- - Properly show initial services in deployment confirmation
3
-
4
- **0.8.4**
1
+ **0.8.4-0.8.8**
5
2
  - Added initial services support, to deploy before all other servies
3
+ - Allow namespace as symbol in kubectl commands
4
+ - Allow setting kubectl entrypoint for configuration
6
5
 
7
6
  **0.8.3**
8
7
  - Always load artifacts, if kubeconfig is an artifact
@@ -8,7 +8,8 @@ class KuberKit::Actions::KubectlAttacher
8
8
 
9
9
  Contract Maybe[String], Hash => Any
10
10
  def call(pod_name, options)
11
- kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
11
+ kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
12
+ kubectl_entrypoint = KuberKit.current_configuration.kubectl_entrypoint
12
13
  deployer_namespace = KuberKit.current_configuration.deployer_namespace
13
14
 
14
15
  if !pod_name
@@ -18,8 +19,9 @@ class KuberKit::Actions::KubectlAttacher
18
19
  kubectl_commands.exec(
19
20
  local_shell, pod_name, "bash", args: "-it",
20
21
  kubeconfig_path: kubeconfig_path,
21
- interactive: true,
22
- namespace: deployer_namespace
22
+ interactive: true,
23
+ namespace: deployer_namespace,
24
+ entrypoint: kubectl_entrypoint
23
25
  )
24
26
 
25
27
  true
@@ -8,7 +8,8 @@ class KuberKit::Actions::KubectlConsole
8
8
 
9
9
  Contract Maybe[String], Hash => Any
10
10
  def call(pod_name, options)
11
- kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
11
+ kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
12
+ kubectl_entrypoint = KuberKit.current_configuration.kubectl_entrypoint
12
13
  deployer_namespace = KuberKit.current_configuration.deployer_namespace
13
14
 
14
15
  if !pod_name
@@ -18,8 +19,9 @@ class KuberKit::Actions::KubectlConsole
18
19
  kubectl_commands.exec(
19
20
  local_shell, pod_name, "bin/console", args: "-it",
20
21
  kubeconfig_path: kubeconfig_path,
21
- interactive: true,
22
- namespace: deployer_namespace
22
+ interactive: true,
23
+ namespace: deployer_namespace,
24
+ entrypoint: kubectl_entrypoint
23
25
  )
24
26
 
25
27
  true
@@ -1,5 +1,5 @@
1
1
  class KuberKit::Core::Configuration
2
- attr_reader :name, :artifacts, :registries, :env_files, :templates, :kubeconfig_path,
2
+ attr_reader :name, :artifacts, :registries, :env_files, :templates, :kubeconfig_path, :kubectl_entrypoint,
3
3
  :services_attributes, :enabled_services, :disabled_services, :default_services,
4
4
  :initial_services, :build_servers, :global_build_vars,
5
5
  :deployer_strategy, :deployer_namespace, :deployer_require_confirmation
@@ -11,6 +11,7 @@ class KuberKit::Core::Configuration
11
11
  env_files: Hash,
12
12
  templates: Hash,
13
13
  kubeconfig_path: Maybe[Or[String, KuberKit::Core::ArtifactPath]],
14
+ kubectl_entrypoint: Maybe[String],
14
15
  services_attributes: HashOf[Symbol => Hash],
15
16
  enabled_services: ArrayOf[Symbol],
16
17
  disabled_services: ArrayOf[Symbol],
@@ -22,7 +23,7 @@ class KuberKit::Core::Configuration
22
23
  deployer_namespace: Maybe[Or[Symbol, String]],
23
24
  deployer_require_confirmation: Bool,
24
25
  ] => Any
25
- def initialize(name:, artifacts:, registries:, env_files:, templates:, kubeconfig_path:,
26
+ def initialize(name:, artifacts:, registries:, env_files:, templates:, kubeconfig_path:, kubectl_entrypoint:,
26
27
  services_attributes:, enabled_services:, disabled_services:, default_services:,
27
28
  initial_services:, build_servers:, global_build_vars:,
28
29
  deployer_strategy:, deployer_namespace:, deployer_require_confirmation:)
@@ -32,6 +33,7 @@ class KuberKit::Core::Configuration
32
33
  @env_files = env_files
33
34
  @templates = templates
34
35
  @kubeconfig_path = kubeconfig_path
36
+ @kubectl_entrypoint = kubectl_entrypoint
35
37
  @build_servers = build_servers
36
38
  @services_attributes = services_attributes
37
39
  @enabled_services = enabled_services
@@ -26,6 +26,7 @@ class KuberKit::Core::ConfigurationDefinition
26
26
  env_files: @env_files,
27
27
  templates: @templates,
28
28
  kubeconfig_path: @kubeconfig_path,
29
+ kubectl_entrypoint: @kubectl_entrypoint,
29
30
  enabled_services: @enabled_services,
30
31
  disabled_services: @disabled_services,
31
32
  default_services: @default_services,
@@ -89,6 +90,12 @@ class KuberKit::Core::ConfigurationDefinition
89
90
  self
90
91
  end
91
92
 
93
+ def kubectl_entrypoint(path)
94
+ @kubectl_entrypoint = path
95
+
96
+ self
97
+ end
98
+
92
99
  def deployer_namespace(namespace)
93
100
  @deployer_namespace = namespace
94
101
 
@@ -26,6 +26,7 @@ class KuberKit::Core::ConfigurationFactory
26
26
  env_files: env_files,
27
27
  templates: templates,
28
28
  kubeconfig_path: configuration_attrs.kubeconfig_path,
29
+ kubectl_entrypoint: configuration_attrs.kubectl_entrypoint,
29
30
  build_servers: build_servers,
30
31
  services_attributes: configuration_attrs.services_attributes,
31
32
  enabled_services: configuration_attrs.enabled_services,
@@ -43,13 +43,17 @@ class KuberKit::Shell::Commands::KubectlCommands
43
43
  kubectl_run(shell, "apply -f #{file_path}", kubeconfig_path: kubeconfig_path, namespace: namespace)
44
44
  end
45
45
 
46
- def exec(shell, pod_name, command, args: nil, kubeconfig_path: nil, interactive: false, namespace: nil)
46
+ def exec(shell, pod_name, command, args: nil, kubeconfig_path: nil, interactive: false, namespace: nil, entrypoint: nil)
47
47
  command_parts = []
48
48
  command_parts << "exec"
49
49
 
50
50
  if args
51
51
  command_parts << args
52
52
  end
53
+
54
+ if entrypoint
55
+ command = entrypoint.gsub("$@", command)
56
+ end
53
57
 
54
58
  command_parts << pod_name
55
59
  command_parts << "-- #{command}"
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.8.7"
2
+ VERSION = "0.8.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuber_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-18 00:00:00.000000000 Z
11
+ date: 2022-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts