Skip to content

Commit

Permalink
⬆️ v0.2.2
Browse files Browse the repository at this point in the history
- Stops generating secret files if it contains `.base64.yml` in the filepath.
- Now only logs the files that have actually been generated
  • Loading branch information
matthewhartstonge committed Oct 14, 2017
1 parent 3d5cbba commit 9cd9b7e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
12 changes: 6 additions & 6 deletions ATTRIBUTIONS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Open Source Library Attributions

## yaml
YAML support for the Go language.
Copyright (c) 2006 Kirill Simonov
* License: [Apache License 2.0](https://github.com/go-yaml/yaml/blob/v2/LICENSE)
* Project: [go-yaml/yaml](https://github.com/go-yaml/yaml)

## api
Soon-to-be the canonical location of the Kubernetes API definition.
Copyright (c) 2014 The Kubernetes Authors.
Expand All @@ -17,3 +11,9 @@ Structured, pluggable logging for Go.
Copyright (c) 2014 Simon Eskildsen
* License: [MIT License](https://github.com/sirupsen/logrus/blob/master/LICENSE)
* project: [sirupsen/logrus](https://github.com/sirupsen/logrus)

## yaml
YAML support for the Go language.
Copyright (c) 2006 Kirill Simonov
* License: [Apache License 2.0](https://github.com/go-yaml/yaml/blob/v2/LICENSE)
* Project: [go-yaml/yaml](https://github.com/go-yaml/yaml)
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# b64secrets changelog
## v0.2.2
- Stops generating secret files if it contains `.base64.yml` in the filepath.
- Now only logs the files that have actually been generated

## v0.2.1
- Fixes logging false negative write errors
- Fixes creating b64 encoded secret files for secret types other than 'Opaque'
Expand Down
14 changes: 10 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ func createSecretsFile(fp string, wpf string) error {
"error": err,
}).Error("file write failure")
}

logger.WithFields(log.Fields{
"originalPath": fp,
"conformedPath": wpf,
}).Info("Created conformed secrets file")
}

logger.WithFields(log.Fields{
"originalPath": fp,
"conformedPath": wpf,
}).Info("Created conformed secrets file")
return nil
}

Expand All @@ -129,6 +130,11 @@ func main() {
}

for _, readFilepath := range glob {
// Don't create secrets from already converted secrets files
if strings.Contains(readFilepath, ".base64.yml") {
continue
}

writeFilepath := fmt.Sprintf("%s.base64.yml", strings.TrimRight(readFilepath, ".yml"))
err := createSecretsFile(readFilepath, writeFilepath)
if err != nil {
Expand Down

0 comments on commit 9cd9b7e

Please sign in to comment.