-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kumari Tanushree
committed
Sep 6, 2022
1 parent
df9179b
commit 386eb4a
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2020 VMware, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package e2e | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func TestNonTypedCharError(t *testing.T) { | ||
env := BuildEnv(t) | ||
logger := Logger{} | ||
kapp := Kapp{t, env.Namespace, env.KappBinaryPath, logger} | ||
kubectl := Kubectl{t, env.Namespace, logger} | ||
|
||
yaml := ` | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: simple-app | ||
spec: | ||
selector: | ||
matchLabels: | ||
simple-app: "" | ||
template: | ||
metadata: | ||
labels: | ||
simple-app: "" | ||
spec: | ||
containers: | ||
- name: simple-app | ||
image: docker.io/dkalinin/k8s-simple-app@sha256:4c8b96d4fffdfae29258d94a22ae4ad1fe36139d47288b8960d9958d1e63a9d0 | ||
env: | ||
- name: HELLO_MSG | ||
value: stranger | ||
envFrom: | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: simple-cm | ||
annotations: | ||
kapp.k14s.io/versioned: "" | ||
data: | ||
hello_msg: carvel | ||
` | ||
|
||
name := "test-non-typed-character-error" | ||
cleanUp := func() { | ||
kapp.Run([]string{"delete", "-a", name}) | ||
} | ||
|
||
cleanUp() | ||
defer cleanUp() | ||
logger.Section("Initial deploy", func() { | ||
kapp.RunWithOpts([]string{"deploy", "-a", name, "-f", "-"}, RunOpts{StdinReader: strings.NewReader(yaml)}) | ||
|
||
NewPresentClusterResource("deployment", "simple-app", env.Namespace, kubectl) | ||
NewPresentClusterResource("configmap", "simple-cm-ver-1", env.Namespace, kubectl) | ||
}) | ||
} |