Skip to content

Commit

Permalink
kpt fn render: e2e test for fnconfig in subdir (#2358)
Browse files Browse the repository at this point in the history
  • Loading branch information
droot committed Jul 15, 2021
1 parent 3a4abcc commit f53f7c7
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 0 deletions.
14 changes: 14 additions & 0 deletions e2e/testdata/fn-render/fnconfig-in-subdir/.expected/config.yaml
@@ -0,0 +1,14 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
28 changes: 28 additions & 0 deletions e2e/testdata/fn-render/fnconfig-in-subdir/.expected/diff.patch
@@ -0,0 +1,28 @@
diff --git a/resources.yaml b/resources.yaml
index 7a494c9..d22aec8 100644
--- a/resources.yaml
+++ b/resources.yaml
@@ -15,12 +15,23 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
+ labels:
+ tier: db
spec:
replicas: 3
+ selector:
+ matchLabels:
+ tier: db
+ template:
+ metadata:
+ labels:
+ tier: db
---
apiVersion: custom.io/v1
kind: Custom
metadata:
name: custom
+ labels:
+ tier: db
spec:
image: nginx:1.2.3
1 change: 1 addition & 0 deletions e2e/testdata/fn-render/fnconfig-in-subdir/.krmignore
@@ -0,0 +1 @@
.expected
8 changes: 8 additions & 0 deletions e2e/testdata/fn-render/fnconfig-in-subdir/Kptfile
@@ -0,0 +1,8 @@
apiVersion: kpt.dev/v1
kind: Kptfile
metadata:
name: app-with-db
pipeline:
mutators:
- image: gcr.io/kpt-fn/set-labels:v0.1
configPath: db/labelconfig.yaml
19 changes: 19 additions & 0 deletions e2e/testdata/fn-render/fnconfig-in-subdir/db/labelconfig.yaml
@@ -0,0 +1,19 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: v1
kind: ConfigMap
metadata:
name: label-config
data:
tier: db
26 changes: 26 additions & 0 deletions e2e/testdata/fn-render/fnconfig-in-subdir/resources.yaml
@@ -0,0 +1,26 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
---
apiVersion: custom.io/v1
kind: Custom
metadata:
name: custom
spec:
image: nginx:1.2.3

0 comments on commit f53f7c7

Please sign in to comment.