kustomizer 0.1.17 → 0.1.18

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: b0e23bb99ff2c5d0462fe3c4514832e3e913af662f3533e13458d6b41efa05a8
4
- data.tar.gz: 9364050fb8ea2baae96f79bc37c1544935f31c2bab9173032e0b67b2142b4a0b
3
+ metadata.gz: 17f8b2a446416a68a00870a0b9d641fe0475cc2ffcbf533f5257b9cd97efed0d
4
+ data.tar.gz: b67ba2a7239880a20ee188cb7a6e88a401ee8687f2d28f8fb685b91e45475bd6
5
5
  SHA512:
6
- metadata.gz: 2011db3757e66d6eab7350ad172f9e8e4fb902c96c571396edf1596d6f44d880634495e480524262e8252e3adaf08b4ae3f231323b0c1e5c3748ee65bd0615c2
7
- data.tar.gz: 33008c799b27b7144823eacf921364628c13ba980f33dba5c400392a452871dfecd40b113423075a9898fbf40c39d2bd1f7fd3bb4c9c1cb1b69767edabc130ae
6
+ metadata.gz: 902d92cdb76b51f380e00e14120720148d879124b53ef37d748b49ade1bda756a522911ae61e0db27aa151c76eb215b913627f169fefd8d69710091aef22a971
7
+ data.tar.gz: 17a85e4d98e49b5a15a313e3e834eb710bf42f12c97722ceb94f56a0ffd6ff49102f5dfdcf3e4e044290e4b1cfb5aeb039b901b1adb22fb32fb1894215b5894b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kustomizer (0.1.17)
4
+ kustomizer (0.1.18)
5
5
  accessory (~> 0.1.11)
6
6
  base32-multi
7
7
 
@@ -5,6 +5,7 @@ require 'kustomize/transform/ref_fixup_transform'
5
5
  require 'kustomize/transform/filter_for_session_specified_component_transform'
6
6
  require 'kustomize/transform/drop_filtered_documents_transform'
7
7
  require 'kustomize/transform/purge_internal_annotations_transform'
8
+ require 'kustomize/transform/application_order_transform'
8
9
 
9
10
  class Kustomize::Emitter::FinalizerEmitter < Kustomize::Emitter
10
11
  def initialize(input_emitter, session:)
@@ -31,7 +32,8 @@ class Kustomize::Emitter::FinalizerEmitter < Kustomize::Emitter
31
32
  Kustomize::Transform::RefFixupTransform.instance,
32
33
  final_filters,
33
34
  Kustomize::Transform::DropFilteredDocumentsTransform.instance,
34
- Kustomize::Transform::PurgeInternalAnnotationsTransform.instance
35
+ Kustomize::Transform::PurgeInternalAnnotationsTransform.instance,
36
+ Kustomize::Transform::ApplicationOrderTransform.instance
35
37
  ].flatten.compact
36
38
  end
37
39
 
@@ -0,0 +1,56 @@
1
+ require 'singleton'
2
+
3
+ require 'kustomize/transform'
4
+
5
+ class Kustomize::Transform::ApplicationOrderTransform < Kustomize::Transform
6
+ include Singleton
7
+
8
+ # order from https://github.com/helm/helm/blob/main/pkg/releaseutil/kind_sorter.go
9
+ KIND_PRIORITIES = [
10
+ "Namespace",
11
+ "NetworkPolicy",
12
+ "ResourceQuota",
13
+ "LimitRange",
14
+ "PodSecurityPolicy",
15
+ "PodDisruptionBudget",
16
+ "ServiceAccount",
17
+ "SealedSecret",
18
+ "Secret",
19
+ "SecretList",
20
+ "ConfigMap",
21
+ "StorageClass",
22
+ "PersistentVolume",
23
+ "PersistentVolumeClaim",
24
+ "CustomResourceDefinition",
25
+ "ClusterRole",
26
+ "ClusterRoleList",
27
+ "ClusterRoleBinding",
28
+ "ClusterRoleBindingList",
29
+ "Role",
30
+ "RoleList",
31
+ "RoleBinding",
32
+ "RoleBindingList",
33
+ "Service",
34
+ "DaemonSet",
35
+ "Pod",
36
+ "ReplicationController",
37
+ "ReplicaSet",
38
+ "Deployment",
39
+ "HorizontalPodAutoscaler",
40
+ "StatefulSet",
41
+
42
+ :unknown_kind,
43
+
44
+ "Job",
45
+ "CronJob",
46
+ "IngressClass",
47
+ "Ingress",
48
+ "APIService",
49
+ ].each_with_index.to_h
50
+
51
+ def rewrite_all(rcs)
52
+ rcs.sort_by do |rc|
53
+ KIND_PRIORITIES[rc['kind']] || KIND_PRIORITIES[:unknown_kind]
54
+ end
55
+ end
56
+ end
@@ -1,3 +1,3 @@
1
1
  module Kustomize
2
- VERSION = "0.1.17"
2
+ VERSION = "0.1.18"
3
3
  end
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.17
4
+ version: 0.1.18
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-10-29 00:00:00.000000000 Z
11
+ date: 2023-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: accessory
@@ -79,6 +79,7 @@ files:
79
79
  - lib/kustomize/session.rb
80
80
  - lib/kustomize/target_spec.rb
81
81
  - lib/kustomize/transform.rb
82
+ - lib/kustomize/transform/application_order_transform.rb
82
83
  - lib/kustomize/transform/common_annotations_transform.rb
83
84
  - lib/kustomize/transform/common_labels_transform.rb
84
85
  - lib/kustomize/transform/drop_filtered_documents_transform.rb
@@ -113,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
114
  - !ruby/object:Gem::Version
114
115
  version: '0'
115
116
  requirements: []
116
- rubygems_version: 3.2.22
117
+ rubygems_version: 3.4.2
117
118
  signing_key:
118
119
  specification_version: 4
119
120
  summary: Pure-ruby impl of Kubernetes kustomize