kustomizer 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f39b98c4f11fd4d80b1a70192211c56532c9033b7f4c9f6fe14ccbf92651f90
|
4
|
+
data.tar.gz: 652461e4c5610ec39a669ee4c224eba7e0d513e96feccb9c3433363b5c8cb659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7068ff28557ca6c1eea591e2e5dbddb8ef666621f575417a08393c78c87ec6e1522b273b70efc433577e126df7eed821a472593f036169c54e23b1793c64350c
|
7
|
+
data.tar.gz: beea6d68509ff19341f0c995baf6211ebec1d39c7116efd3effef9d3b8f12a4171e5d84f05f909380e5b1e2a449914d389bed20809dd9da6ddf7364ace15481e
|
data/Gemfile.lock
CHANGED
data/lib/kustomize.rb
CHANGED
@@ -5,18 +5,22 @@ require 'kustomize/session'
|
|
5
5
|
|
6
6
|
require 'kustomize/emitter/file_emitter'
|
7
7
|
require 'kustomize/emitter/directory_emitter'
|
8
|
+
require 'kustomize/emitter/finalizer_emitter'
|
8
9
|
require 'kustomize/emitter/document_emitter/kustomization_document_emitter'
|
9
10
|
|
10
11
|
module Kustomize
|
11
12
|
def self.load(rel_path_or_rc, session: Kustomize::Session.new, source_path: nil)
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
base_emitter =
|
14
|
+
case rel_path_or_rc
|
15
|
+
when String, Pathname
|
16
|
+
load_path(rel_path_or_rc, session: session)
|
17
|
+
when Hash
|
18
|
+
load_doc(rel_path_or_rc, session: session, source_path: source_path)
|
19
|
+
else
|
20
|
+
raise ArgumentError, "must be a kustomization document or a path to one, instead got: #{rel_path_or_rc.inspect}"
|
21
|
+
end
|
22
|
+
|
23
|
+
Kustomize::Emitter::FinalizerEmitter.new(base_emitter)
|
20
24
|
end
|
21
25
|
|
22
26
|
def self.load_doc(rc, session: Kustomize::Session.new, source_path:)
|
@@ -107,11 +107,8 @@ class Kustomize::Emitter::DocumentEmitter::KustomizationDocumentEmitter < Kustom
|
|
107
107
|
@transforms = [
|
108
108
|
self.namespace_transforms,
|
109
109
|
self.image_transforms,
|
110
|
-
Kustomize::Transform::FingerprintSuffixTransform.instance,
|
111
110
|
self.json_6902_patch_transforms,
|
112
|
-
self.transformer_plugin_transforms
|
113
|
-
Kustomize::Transform::RefFixupTransform.instance,
|
114
|
-
Kustomize::Transform::PurgeInternalAnnotationsTransform.instance
|
111
|
+
self.transformer_plugin_transforms
|
115
112
|
].flatten
|
116
113
|
end
|
117
114
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'kustomize/emitter'
|
2
|
+
|
3
|
+
require 'kustomize/transform/fingerprint_suffix_transform'
|
4
|
+
require 'kustomize/transform/ref_fixup_transform'
|
5
|
+
require 'kustomize/transform/purge_internal_annotations_transform'
|
6
|
+
|
7
|
+
class Kustomize::Emitter::FinalizerEmitter < Kustomize::Emitter
|
8
|
+
def initialize(input_emitter)
|
9
|
+
@input_emitter = input_emitter
|
10
|
+
end
|
11
|
+
|
12
|
+
def input_emitters
|
13
|
+
[@input_emitter]
|
14
|
+
end
|
15
|
+
|
16
|
+
def transforms
|
17
|
+
return @transforms if @transforms
|
18
|
+
|
19
|
+
@transforms = [
|
20
|
+
Kustomize::Transform::FingerprintSuffixTransform.instance,
|
21
|
+
Kustomize::Transform::RefFixupTransform.instance,
|
22
|
+
Kustomize::Transform::PurgeInternalAnnotationsTransform.instance
|
23
|
+
].flatten
|
24
|
+
end
|
25
|
+
|
26
|
+
def emit
|
27
|
+
self.transforms.inject(self.input_resources) do |rcs, xform|
|
28
|
+
xform.rewrite_all(rcs)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/kustomize/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kustomizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Levi Aul
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: accessory
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/kustomize/emitter/document_emitter.rb
|
64
64
|
- lib/kustomize/emitter/document_emitter/kustomization_document_emitter.rb
|
65
65
|
- lib/kustomize/emitter/file_emitter.rb
|
66
|
+
- lib/kustomize/emitter/finalizer_emitter.rb
|
66
67
|
- lib/kustomize/emitter/generator_plugins_emitter.rb
|
67
68
|
- lib/kustomize/generator_plugin.rb
|
68
69
|
- lib/kustomize/json_6902_patch.rb
|