error logging as string instead of []byte

This commit is contained in:
Nikolaos Moraitis 2019-02-12 20:34:50 +01:00
parent dad8bc8a4e
commit 45ac899894
2 changed files with 3 additions and 3 deletions

View File

@ -289,10 +289,10 @@ func validateNewConfigMap(configMap *v1.ConfigMap, keyName string) error {
}
if _, exists := configMap.Data[keyName]; exists {
return fmt.Errorf("cannot add key %s, another key by that name already exists in data: %v", keyName, configMap.Data)
return fmt.Errorf("cannot add key %q, another key by that name already exists in Data for ConfigMap %q", keyName, configMap.Name)
}
if _, exists := configMap.BinaryData[keyName]; exists {
return fmt.Errorf("cannot add key %s, another key by that name already exists in binaryData: %v", keyName, configMap.BinaryData)
return fmt.Errorf("cannot add key %q, another key by that name already exists in BinaryData for ConfigMap %q", keyName, configMap.Name)
}
return nil
}

View File

@ -265,7 +265,7 @@ func addKeyFromLiteralToSecret(secret *v1.Secret, keyName string, data []byte) e
}
if _, entryExists := secret.Data[keyName]; entryExists {
return fmt.Errorf("cannot add key %s, another key by that name already exists: %v", keyName, secret.Data)
return fmt.Errorf("cannot add key %s, another key by that name already exists", keyName)
}
secret.Data[keyName] = data
return nil