Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
396e2bc5
Commit
396e2bc5
authored
Dec 19, 2016
by
Jan Safranek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add configmap test
parent
2970761c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
volumes.go
test/e2e/volumes.go
+78
-0
No files found.
test/e2e/volumes.go
View file @
396e2bc5
...
...
@@ -828,4 +828,82 @@ var _ = framework.KubeDescribe("Volumes [Feature:Volumes]", func() {
testVolumeClient
(
cs
,
config
,
&
fsGroup
,
tests
)
})
})
////////////////////////////////////////////////////////////////////////
// ConfigMap
////////////////////////////////////////////////////////////////////////
framework
.
KubeDescribe
(
"ConfigMap"
,
func
()
{
It
(
"should be mountable"
,
func
()
{
config
:=
VolumeTestConfig
{
namespace
:
namespace
.
Name
,
prefix
:
"configmap"
,
}
defer
func
()
{
if
clean
{
volumeTestCleanup
(
f
,
config
)
}
}()
configMap
:=
&
v1
.
ConfigMap
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"ConfigMap"
,
APIVersion
:
"v1"
,
},
ObjectMeta
:
v1
.
ObjectMeta
{
Name
:
config
.
prefix
+
"-map"
,
},
Data
:
map
[
string
]
string
{
"first"
:
"this is the first file"
,
"second"
:
"this is the second file"
,
"third"
:
"this is the third file"
,
},
}
if
_
,
err
:=
cs
.
Core
()
.
ConfigMaps
(
namespace
.
Name
)
.
Create
(
configMap
);
err
!=
nil
{
framework
.
Failf
(
"unable to create test configmap: %v"
,
err
)
}
defer
func
()
{
_
=
cs
.
Core
()
.
ConfigMaps
(
namespace
.
Name
)
.
Delete
(
configMap
.
Name
,
nil
)
}()
// Test one ConfigMap mounted several times to test #28502
tests
:=
[]
VolumeTest
{
{
volume
:
v1
.
VolumeSource
{
ConfigMap
:
&
v1
.
ConfigMapVolumeSource
{
LocalObjectReference
:
v1
.
LocalObjectReference
{
Name
:
config
.
prefix
+
"-map"
,
},
Items
:
[]
v1
.
KeyToPath
{
{
Key
:
"first"
,
Path
:
"firstfile"
,
},
},
},
},
file
:
"firstfile"
,
expectedContent
:
"this is the first file"
,
},
{
volume
:
v1
.
VolumeSource
{
ConfigMap
:
&
v1
.
ConfigMapVolumeSource
{
LocalObjectReference
:
v1
.
LocalObjectReference
{
Name
:
config
.
prefix
+
"-map"
,
},
Items
:
[]
v1
.
KeyToPath
{
{
Key
:
"second"
,
Path
:
"secondfile"
,
},
},
},
},
file
:
"secondfile"
,
expectedContent
:
"this is the second file"
,
},
}
testVolumeClient
(
cs
,
config
,
nil
,
tests
)
})
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment