Skip to content

Commit ed64123

Browse files
authored
exclude kustomization files from KRM check (#2409)
1 parent fa499d6 commit ed64123

File tree

14 files changed

+391
-7
lines changed

14 files changed

+391
-7
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
testType: eval
16+
image: gcr.io/kpt-fn/set-labels:v0.1
17+
args:
18+
tier: backend
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
diff --git a/kustomization.yaml b/kustomization.yaml
2+
index f91c46a..94769e0 100644
3+
--- a/kustomization.yaml
4+
+++ b/kustomization.yaml
5+
@@ -11,7 +11,9 @@
6+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7+
# See the License for the specific language governing permissions and
8+
# limitations under the License.
9+
-
10+
# kustomization.yaml contents
11+
resources:
12+
- resources.yaml
13+
+metadata:
14+
+ labels:
15+
+ tier: backend
16+
diff --git a/resources.yaml b/resources.yaml
17+
index f6f4685..b11c929 100644
18+
--- a/resources.yaml
19+
+++ b/resources.yaml
20+
@@ -15,12 +15,23 @@ apiVersion: apps/v1
21+
kind: Deployment
22+
metadata:
23+
name: nginx-deployment
24+
+ labels:
25+
+ tier: backend
26+
spec:
27+
replicas: 3
28+
+ selector:
29+
+ matchLabels:
30+
+ tier: backend
31+
+ template:
32+
+ metadata:
33+
+ labels:
34+
+ tier: backend
35+
---
36+
apiVersion: custom.io/v1
37+
kind: Custom
38+
metadata:
39+
name: custom
40+
+ labels:
41+
+ tier: backend
42+
spec:
43+
image: nginx:1.2.3 # kpt-set: {something}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.expected
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kpt.dev/v1
2+
kind: Kptfile
3+
metadata:
4+
name: app
5+
pipeline:
6+
mutators:
7+
- image: set-labels:v0.1
8+
configMap:
9+
tier: backend
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# kustomization.yaml contents
16+
resources:
17+
- resources.yaml
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
apiVersion: apps/v1
15+
kind: Deployment
16+
metadata:
17+
name: nginx-deployment
18+
spec:
19+
replicas: 3
20+
---
21+
apiVersion: custom.io/v1
22+
kind: Custom
23+
metadata:
24+
name: custom
25+
spec:
26+
image: nginx:1.2.3 # kpt-set: {something}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
diff --git a/kustomization.yaml b/kustomization.yaml
2+
index f91c46a..94769e0 100644
3+
--- a/kustomization.yaml
4+
+++ b/kustomization.yaml
5+
@@ -11,7 +11,9 @@
6+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7+
# See the License for the specific language governing permissions and
8+
# limitations under the License.
9+
-
10+
# kustomization.yaml contents
11+
resources:
12+
- resources.yaml
13+
+metadata:
14+
+ labels:
15+
+ tier: backend
16+
diff --git a/resources.yaml b/resources.yaml
17+
index f6f4685..b11c929 100644
18+
--- a/resources.yaml
19+
+++ b/resources.yaml
20+
@@ -15,12 +15,23 @@ apiVersion: apps/v1
21+
kind: Deployment
22+
metadata:
23+
name: nginx-deployment
24+
+ labels:
25+
+ tier: backend
26+
spec:
27+
replicas: 3
28+
+ selector:
29+
+ matchLabels:
30+
+ tier: backend
31+
+ template:
32+
+ metadata:
33+
+ labels:
34+
+ tier: backend
35+
---
36+
apiVersion: custom.io/v1
37+
kind: Custom
38+
metadata:
39+
name: custom
40+
+ labels:
41+
+ tier: backend
42+
spec:
43+
image: nginx:1.2.3 # kpt-set: {something}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kpt.dev/v1
2+
kind: Kptfile
3+
metadata:
4+
name: app
5+
pipeline:
6+
mutators:
7+
- image: set-labels:v0.1
8+
configMap:
9+
tier: backend
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# kustomization.yaml contents
16+
resources:
17+
- resources.yaml
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
apiVersion: apps/v1
15+
kind: Deployment
16+
metadata:
17+
name: nginx-deployment
18+
spec:
19+
replicas: 3
20+
---
21+
apiVersion: custom.io/v1
22+
kind: Custom
23+
metadata:
24+
name: custom
25+
spec:
26+
image: nginx:1.2.3 # kpt-set: {something}

0 commit comments

Comments
 (0)