diff --git a/README.md b/README.md index 991f4c2..01739a8 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ secrets: data: - name: foo extension: txt - unzip: false + zip: false nameAsSubPath: false ``` @@ -86,7 +86,7 @@ Description of the options used in manifest: `/secret/data`, while in V1 API it would be directly `/secret`; - `name.data.name`: file name; - `name.data.extension`: file extension; -- `name.data.unzip`: file contents is GZIP, needs to be decompressed; +- `name.data.zip`: file contents is GZIP, needs to be compressed/decompressed; - `name.data.nameAsSubPath`: employ name as final part of the Vault path `name.path`; ### File Naming Convention diff --git a/pkg/vault-handler/handler.go b/pkg/vault-handler/handler.go index 386e41a..2d6f651 100644 --- a/pkg/vault-handler/handler.go +++ b/pkg/vault-handler/handler.go @@ -49,7 +49,7 @@ func (h *Handler) Upload(manifest *Manifest) error { logger = logger.WithFields(log.Fields{ "name": data.Name, "extension": data.Extension, - "unzip": data.Unzip, + "zip": data.Zip, }) logger.Info("Handling file") @@ -60,7 +60,7 @@ func (h *Handler) Upload(manifest *Manifest) error { return err } - if data.Unzip { + if data.Zip { if err = file.Zip(); err != nil { logger.Error("error on zipping payload", err) return err @@ -92,7 +92,7 @@ func (h *Handler) Download(manifest *Manifest) error { logger.WithFields(log.Fields{ "name": data.Name, "extension": data.Extension, - "unzip": data.Unzip, + "zip": data.Zip, "vaultPath": vaultPath, }).Info("Reading data from Vault") @@ -101,7 +101,7 @@ func (h *Handler) Download(manifest *Manifest) error { } file := NewFile(group, &data, payload) - if data.Unzip { + if data.Zip { if err = file.Unzip(); err != nil { return err } diff --git a/pkg/vault-handler/manifest.go b/pkg/vault-handler/manifest.go index a23488d..99de72b 100644 --- a/pkg/vault-handler/manifest.go +++ b/pkg/vault-handler/manifest.go @@ -19,7 +19,7 @@ type Secrets struct { type SecretData struct { Name string `yaml:"name"` // file name Extension string `yaml:"extension"` // file extension - Unzip bool `yaml:"unzip,omitempty"` // unzip data after download + Zip bool `yaml:"zip,omitempty"` // deal with zipped payload NameAsSubPath bool `yaml:"nameAsSubPath,omitempty"` // employ name as part of the path } diff --git a/test/manifest.yaml b/test/manifest.yaml index 3c04606..dd0da7b 100644 --- a/test/manifest.yaml +++ b/test/manifest.yaml @@ -14,6 +14,6 @@ secrets: # file extension extension: txt # when using "file" as type # unzip payload - unzip: false # only when having "file" as type + zip: false # only when having "file" as type # use key-name as part of vault path nameAsSubPath: false