create LocalObjectReference

This commit is contained in:
deads2k
2015-05-19 08:39:46 -04:00
parent 0c14e0cbdb
commit 5458f05679
11 changed files with 89 additions and 46 deletions

View File

@@ -891,10 +891,12 @@ func validateHostNetwork(hostNetwork bool, containers []api.Container) errs.Vali
return allErrors
}
func validateImagePullSecrets(imagePullSecrets []api.ObjectReference) errs.ValidationErrorList {
// validateImagePullSecrets checks to make sure the pull secrets are well formed. Right now, we only expect name to be set (it's the only field). If this ever changes
// and someone decides to set those fields, we'd like to know.
func validateImagePullSecrets(imagePullSecrets []api.LocalObjectReference) errs.ValidationErrorList {
allErrors := errs.ValidationErrorList{}
for i, currPullSecret := range imagePullSecrets {
strippedRef := api.ObjectReference{Name: currPullSecret.Name}
strippedRef := api.LocalObjectReference{Name: currPullSecret.Name}
if !reflect.DeepEqual(strippedRef, currPullSecret) {
allErrors = append(allErrors, errs.NewFieldInvalid(fmt.Sprintf("[%d]", i), currPullSecret, "only name may be set"))