GoogleCloudPlatform / berglas

A tool for managing secrets on Google Cloud
https://cloud.google.com/secret-manager
Apache License 2.0
1.24k stars 96 forks source link

Only replacing destination file character by character #142

Closed densk1 closed 3 years ago

densk1 commented 3 years ago

I have the following step in a cloudbuild.yaml file. It replaces the development config.js file with a production config file.

The production config file has fewer lines than the development one. When Berglas is overwriting the destination file, it appears to overwrite each character from the new file, until it runs out of characters.

This is leaving my updated config file corrupted because it is not syntactically correct.

steps:
  - id: get-secrets
    name: gcr.io/berglas/berglas
    env:
      - 'CONFIG_FILE=sm://$PROJECT_ID/config-production?destination=src/config/config.js'
    args: ["exec", "--", "/bin/sh"]

Expectation My expectation is that the whole file would be overwritten.

Current Workaround I have added multiple empty lines to the top of the production config file.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.