Change SecretVolumeSource to use a secret name instead of ObjRef

This commit is contained in:
Paul Morie
2015-03-24 13:17:14 -04:00
parent 1dc7bcf53b
commit e40ba109a1
13 changed files with 96 additions and 33 deletions

View File

@@ -462,3 +462,31 @@ func TestEndpointsConversion(t *testing.T) {
}
}
}
func TestSecretVolumeSourceConversion(t *testing.T) {
given := current.SecretVolumeSource{
Target: current.ObjectReference{
ID: "foo",
},
}
expected := newer.SecretVolumeSource{
SecretName: "foo",
}
got := newer.SecretVolumeSource{}
if err := Convert(&given, &got); err != nil {
t.Errorf("Unexpected error: %v", err)
}
if got.SecretName != expected.SecretName {
t.Errorf("Expected %v; got %v", expected, got)
}
got2 := current.SecretVolumeSource{}
if err := Convert(&got, &got2); err != nil {
t.Errorf("Unexpected error: %v", err)
}
if got2.Target.ID != given.Target.ID {
t.Errorf("Expected %v; got %v", given, got2)
}
}