Commit 50d3909d authored by zhangxiaoyu-zidif's avatar zhangxiaoyu-zidif

secret.go: add initial symbol and format err

parent ed539fb7
...@@ -154,8 +154,7 @@ func handleFromLiteralSources(secret *api.Secret, literalSources []string) error ...@@ -154,8 +154,7 @@ func handleFromLiteralSources(secret *api.Secret, literalSources []string) error
if err != nil { if err != nil {
return err return err
} }
err = addKeyFromLiteralToSecret(secret, keyName, []byte(value)) if err = addKeyFromLiteralToSecret(secret, keyName, []byte(value)); err != nil {
if err != nil {
return err return err
} }
} }
...@@ -190,15 +189,13 @@ func handleFromFileSources(secret *api.Secret, fileSources []string) error { ...@@ -190,15 +189,13 @@ func handleFromFileSources(secret *api.Secret, fileSources []string) error {
itemPath := path.Join(filePath, item.Name()) itemPath := path.Join(filePath, item.Name())
if item.Mode().IsRegular() { if item.Mode().IsRegular() {
keyName = item.Name() keyName = item.Name()
err = addKeyFromFileToSecret(secret, keyName, itemPath) if err = addKeyFromFileToSecret(secret, keyName, itemPath); err != nil {
if err != nil {
return err return err
} }
} }
} }
} else { } else {
err = addKeyFromFileToSecret(secret, keyName, filePath) if err := addKeyFromFileToSecret(secret, keyName, filePath); err != nil {
if err != nil {
return err return err
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment