mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
write krm metadata to Krmfile instead of Kustomization
This commit is contained in:
committed by
Phillip Wittrock
parent
c1a2bf14da
commit
0e5e2648b3
57
cmd/config/internal/commands/e2e/create_setter_test.go
Normal file
57
cmd/config/internal/commands/e2e/create_setter_test.go
Normal file
@@ -0,0 +1,57 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package e2e
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCreateSetter(t *testing.T) {
|
||||
tests := []test{
|
||||
{
|
||||
name: "create_setter",
|
||||
args: []string{"create-setter", ".", "replicas", "3"},
|
||||
files: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
replicas: 3
|
||||
`,
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
kind: Krmfile
|
||||
`,
|
||||
},
|
||||
expectedFiles: map[string]string{
|
||||
"deployment.yaml": `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-deployment
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
replicas: 3 # {"$openapi":"replicas"}
|
||||
`,
|
||||
"Krmfile": `
|
||||
apiVersion: config.k8s.io/v1alpha1
|
||||
kind: Krmfile
|
||||
openAPI:
|
||||
definitions:
|
||||
io.k8s.cli.setters.replicas:
|
||||
x-k8s-cli:
|
||||
setter:
|
||||
name: replicas
|
||||
value: "3"
|
||||
`,
|
||||
},
|
||||
},
|
||||
}
|
||||
runTests(t, tests)
|
||||
}
|
||||
Reference in New Issue
Block a user