mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-01 02:38:12 +00:00 
			
		
		
		
	Fix string output format for secret validations
This commit is contained in:
		| @@ -5486,13 +5486,13 @@ func ValidateSecret(secret *core.Secret) field.ErrorList { | ||||
|  | ||||
| 		// username or password might be empty, but the field must be present | ||||
| 		if !usernameFieldExists && !passwordFieldExists { | ||||
| 			allErrs = append(allErrs, field.Required(field.NewPath("data[%s]").Key(core.BasicAuthUsernameKey), "")) | ||||
| 			allErrs = append(allErrs, field.Required(field.NewPath("data[%s]").Key(core.BasicAuthPasswordKey), "")) | ||||
| 			allErrs = append(allErrs, field.Required(dataPath.Key(core.BasicAuthUsernameKey), "")) | ||||
| 			allErrs = append(allErrs, field.Required(dataPath.Key(core.BasicAuthPasswordKey), "")) | ||||
| 			break | ||||
| 		} | ||||
| 	case core.SecretTypeSSHAuth: | ||||
| 		if len(secret.Data[core.SSHAuthPrivateKey]) == 0 { | ||||
| 			allErrs = append(allErrs, field.Required(field.NewPath("data[%s]").Key(core.SSHAuthPrivateKey), "")) | ||||
| 			allErrs = append(allErrs, field.Required(dataPath.Key(core.SSHAuthPrivateKey), "")) | ||||
| 			break | ||||
| 		} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Vivek Koppuru
					Vivek Koppuru