mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Update mount flag to match docker docs
- Also modify TODO in validator-kubeval example
This commit is contained in:
@@ -55,7 +55,7 @@ func GetRunFnRunner(name string) *RunFnRunner {
|
||||
&r.Network, "network", false, "enable network access for functions that declare it")
|
||||
r.Command.Flags().StringVar(
|
||||
&r.NetworkName, "network-name", "bridge", "the docker network to run the container in")
|
||||
r.Command.Flags().StringSliceVar(
|
||||
r.Command.Flags().StringArrayVar(
|
||||
&r.Mounts, "mount", []string{},
|
||||
"a list of storage options read from the filesystem")
|
||||
return r
|
||||
|
||||
@@ -219,12 +219,12 @@ apiVersion: v1
|
||||
{
|
||||
name: "custom kind with storage mounts",
|
||||
args: []string{
|
||||
"run", "dir", "--mount", "type=bind;src=/mount/path;dst=/local/",
|
||||
"--mount", "type=volume;src=myvol;dst=/local/",
|
||||
"--mount", "type=tmpfs;dst=/local/",
|
||||
"run", "dir", "--mount", "type=bind,src=/mount/path,dst=/local/",
|
||||
"--mount", "type=volume,src=myvol,dst=/local/",
|
||||
"--mount", "type=tmpfs,dst=/local/",
|
||||
"--image", "foo:bar", "--", "Foo", "g=h", "i=j=k"},
|
||||
path: "dir",
|
||||
mount: []string{"type=bind;src=/mount/path;dst=/local/", "type=volume;src=myvol;dst=/local/", "type=tmpfs;dst=/local/"},
|
||||
mount: []string{"type=bind,src=/mount/path,dst=/local/", "type=volume,src=myvol,dst=/local/", "type=tmpfs,dst=/local/"},
|
||||
expected: `
|
||||
metadata:
|
||||
name: function-input
|
||||
|
||||
@@ -12,6 +12,12 @@ spec:
|
||||
strict: true
|
||||
ignoreMissingSchemas: true
|
||||
|
||||
# TODO: Update this to use network/volumes features.
|
||||
# Relevant issues:
|
||||
# - https://github.com/kubernetes-sigs/kustomize/issues/1901
|
||||
# - https://github.com/kubernetes-sigs/kustomize/issues/1902
|
||||
kubernetesVersion: "1.16.0"
|
||||
schemaLocation: "file:///schemas"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
||||
@@ -162,7 +162,7 @@ func (s *StorageMount) String() string {
|
||||
|
||||
func StringToStorageMount(s string) StorageMount {
|
||||
m := make(map[string]string)
|
||||
options := strings.Split(s, ";")
|
||||
options := strings.Split(s, ",")
|
||||
for _, option := range options {
|
||||
keyVal := strings.Split(option, "=")
|
||||
m[keyVal[0]] = keyVal[1]
|
||||
|
||||
Reference in New Issue
Block a user