Add support for binary file in configmap

This commit is contained in:
Lukasz Zajaczkowski
2016-09-23 13:48:32 +02:00
committed by Davanum Srinivas
parent 5f6e12793b
commit 7e158fb4f6
9 changed files with 222 additions and 44 deletions

View File

@@ -62,6 +62,38 @@ func TestMakePayload(t *testing.T) {
},
success: true,
},
{
name: "no overrides binary data",
configMap: &v1.ConfigMap{
BinaryData: map[string][]byte{
"foo": []byte("foo"),
"bar": []byte("bar"),
},
},
mode: 0644,
payload: map[string]util.FileProjection{
"foo": {Data: []byte("foo"), Mode: 0644},
"bar": {Data: []byte("bar"), Mode: 0644},
},
success: true,
},
{
name: "no overrides mixed data",
configMap: &v1.ConfigMap{
BinaryData: map[string][]byte{
"foo": []byte("foo"),
},
Data: map[string]string{
"bar": "bar",
},
},
mode: 0644,
payload: map[string]util.FileProjection{
"foo": {Data: []byte("foo"), Mode: 0644},
"bar": {Data: []byte("bar"), Mode: 0644},
},
success: true,
},
{
name: "basic 1",
mappings: []v1.KeyToPath{