Skip to content

Commit e036b65

Browse files
Update kyaml and add e2e tests (#2486)
1 parent 6bae6f6 commit e036b65

File tree

10 files changed

+138
-1
lines changed

10 files changed

+138
-1
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-namespace:v0.1.3
17+
args:
18+
namespace: staging
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/resources.yaml b/resources.yaml
2+
index 4a7ba01..4d4f59f 100644
3+
--- a/resources.yaml
4+
+++ b/resources.yaml
5+
@@ -16,6 +16,7 @@ kind: Deployment
6+
metadata:
7+
name: nginx-deployment
8+
createTimestamp: null
9+
+ namespace: staging
10+
spec:
11+
replicas: 3
12+
---
13+
@@ -23,5 +24,6 @@ apiVersion: custom.io/v1
14+
kind: Custom
15+
metadata:
16+
name: custom
17+
+ namespace: staging
18+
spec:
19+
image: nginx:1.2.3
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.expected
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
createTimestamp: null
19+
spec:
20+
replicas: 3
21+
---
22+
apiVersion: custom.io/v1
23+
kind: Custom
24+
metadata:
25+
name: custom
26+
spec:
27+
image: nginx:1.2.3
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/resources.yaml b/resources.yaml
2+
index 4a7ba01..f883068 100644
3+
--- a/resources.yaml
4+
+++ b/resources.yaml
5+
@@ -16,12 +16,25 @@ kind: Deployment
6+
metadata:
7+
name: nginx-deployment
8+
createTimestamp: null
9+
+ namespace: staging
10+
+ labels:
11+
+ tier: backend
12+
spec:
13+
replicas: 3
14+
+ selector:
15+
+ matchLabels:
16+
+ tier: backend
17+
+ template:
18+
+ metadata:
19+
+ labels:
20+
+ tier: backend
21+
---
22+
apiVersion: custom.io/v1
23+
kind: Custom
24+
metadata:
25+
name: custom
26+
+ namespace: staging
27+
+ labels:
28+
+ tier: backend
29+
spec:
30+
image: nginx:1.2.3
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.expected
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: kpt.dev/v1
2+
kind: Kptfile
3+
metadata:
4+
name: app
5+
pipeline:
6+
mutators:
7+
- image: gcr.io/kpt-fn/set-namespace:v0.1.3
8+
configMap:
9+
namespace: staging
10+
- image: gcr.io/kpt-fn/set-labels:v0.1.4
11+
configMap:
12+
tier: backend
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
createTimestamp: null
19+
spec:
20+
replicas: 3
21+
---
22+
apiVersion: custom.io/v1
23+
kind: Custom
24+
metadata:
25+
name: custom
26+
spec:
27+
image: nginx:1.2.3

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ require (
2424
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9
2525
sigs.k8s.io/cli-utils v0.25.1-0.20210702190410-c1a7c2d0409d
2626
sigs.k8s.io/kustomize/api v0.8.10
27-
sigs.k8s.io/kustomize/kyaml v0.11.1-0.20210715213702-35d1c3f9b418
27+
sigs.k8s.io/kustomize/kyaml v0.11.2-0.20210908182956-2b8a39373e88
2828
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,8 @@ sigs.k8s.io/kustomize/kyaml v0.10.17/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4
994994
sigs.k8s.io/kustomize/kyaml v0.10.20/go.mod h1:TYWhGwW9vjoRh3rWqBwB/ZOXyEGRVWe7Ggc3+KZIO+c=
995995
sigs.k8s.io/kustomize/kyaml v0.11.1-0.20210715213702-35d1c3f9b418 h1:aFl1EFMI4TNZ10Zga2LMGQDopLqM85os8ggXJZLGTIY=
996996
sigs.k8s.io/kustomize/kyaml v0.11.1-0.20210715213702-35d1c3f9b418/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E=
997+
sigs.k8s.io/kustomize/kyaml v0.11.2-0.20210908182956-2b8a39373e88 h1:oAFCwINXUpDfmRrof559WnkAMIVQl6gTTrMaXsYAOrc=
998+
sigs.k8s.io/kustomize/kyaml v0.11.2-0.20210908182956-2b8a39373e88/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E=
997999
sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
9981000
sigs.k8s.io/structured-merge-diff/v4 v4.1.0 h1:C4r9BgJ98vrKnnVCjwCSXcWjWe0NKcUQkmzDXZXGwH8=
9991001
sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=

0 commit comments

Comments
 (0)