kubes 0.3.3 → 0.3.4
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 +4 -0
- data/lib/kubes/cli/init.rb +34 -2
- data/lib/kubes/cli/logs.rb +3 -2
- data/lib/kubes/version.rb +1 -1
- data/lib/templates/dsl/.kubes/resources/base/all.rb.tt +6 -1
- data/lib/templates/dsl/.kubes/resources/shared/namespace.rb.tt +1 -1
- data/lib/templates/yaml/.kubes/resources/base/all.yaml.tt +1 -1
- data/lib/templates/yaml/.kubes/resources/shared/namespace.yaml.tt +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c14d045b8c029e76e1c001f26a0b77c97ecdabc45ddc964660372f2170f95690
|
4
|
+
data.tar.gz: 36a0b622a75cc18e74d78537a2a3f421e15de150cb89978434a58d31c37b799b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd0f40a09c2909be4820c0575d6a8ef850b1977e21cd5d040cb82cb11411500a136608035635f743cb1a967116913856fc5e7997f3fef511b5c07d94d5fe4458
|
7
|
+
data.tar.gz: 9f29e9bf7a4615bb2a9864b9acdc9aa83b70583b5743decd5e8c6bac1b85b49bfc90a724403765afe2a86fa1cd1819cccedc53b7b91d6e858a20ececf2630f6a
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.3.4]
|
7
|
+
- #24 fix namespace newline and logs for single container
|
8
|
+
- #23 init namespace option
|
9
|
+
|
6
10
|
## [0.3.3]
|
7
11
|
- #22 logs -c option. fix kubes logs for pods with multiple containers
|
8
12
|
|
data/lib/kubes/cli/init.rb
CHANGED
@@ -6,6 +6,7 @@ class Kubes::CLI
|
|
6
6
|
[:force, type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files"],
|
7
7
|
[:type, aliases: ["t"], default: "yaml", desc: "Type: dsl or yaml"],
|
8
8
|
[:repo, required: true, desc: "Docker repo name. Example: user/repo. Configures .kubes/config.rb"],
|
9
|
+
[:namespace, aliases: ["n"], desc: "Namespace to use, defaults to the app option"],
|
9
10
|
]
|
10
11
|
end
|
11
12
|
|
@@ -17,6 +18,37 @@ class Kubes::CLI
|
|
17
18
|
@options[:app]
|
18
19
|
end
|
19
20
|
|
21
|
+
def namespace
|
22
|
+
@options[:namespace] || @options[:app]
|
23
|
+
end
|
24
|
+
|
25
|
+
def excludes
|
26
|
+
if namespace == "default"
|
27
|
+
case options[:type]
|
28
|
+
when "dsl"
|
29
|
+
%w[
|
30
|
+
namespace.rb.tt
|
31
|
+
]
|
32
|
+
else
|
33
|
+
%w[
|
34
|
+
all.yaml.tt
|
35
|
+
namespace.yaml.tt
|
36
|
+
]
|
37
|
+
end
|
38
|
+
else
|
39
|
+
[]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def directory_options
|
44
|
+
if excludes.empty?
|
45
|
+
{}
|
46
|
+
else
|
47
|
+
pattern = Regexp.new(excludes.join('|'))
|
48
|
+
{exclude_pattern: pattern }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
20
52
|
public
|
21
53
|
def create_dockefile
|
22
54
|
return if File.exist?("Dockerfile")
|
@@ -32,13 +64,13 @@ class Kubes::CLI
|
|
32
64
|
def create_dsl_files
|
33
65
|
return unless @options[:type] == "dsl"
|
34
66
|
set_source("dsl")
|
35
|
-
directory ".", "."
|
67
|
+
directory ".", ".", directory_options
|
36
68
|
end
|
37
69
|
|
38
70
|
def create_yaml_files
|
39
71
|
return if @options[:type] == "dsl"
|
40
72
|
set_source("yaml")
|
41
|
-
directory ".", "."
|
73
|
+
directory ".", ".", directory_options
|
42
74
|
end
|
43
75
|
|
44
76
|
def message
|
data/lib/kubes/cli/logs.rb
CHANGED
@@ -10,8 +10,9 @@ class Kubes::CLI
|
|
10
10
|
ns = metadata['namespace']
|
11
11
|
|
12
12
|
follow = " -f" if @options[:follow]
|
13
|
-
|
14
|
-
|
13
|
+
container = container(deployment)
|
14
|
+
c = " -c #{container}" if container
|
15
|
+
sh("kubectl logs deployment/#{name}#{follow} -n #{ns}#{c}")
|
15
16
|
end
|
16
17
|
|
17
18
|
private
|
data/lib/kubes/version.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
name "<%=
|
1
|
+
name "<%= namespace %>"
|
2
2
|
labels(app: "<%= app %>")
|
@@ -1,2 +1,2 @@
|
|
1
1
|
metadata:
|
2
|
-
namespace: <%=
|
2
|
+
namespace: <%= namespace %>
|