Registry: default storage delete will fail if secret does not have trailing newline
Summary
Taken from https://gitlab.com/charts/gitlab/issues/712#note_123284849
In addressing #901 (closed), !579 (merged) added an appending if there was no existing definition for the delete
property of the storage block for the Docker registry configuration.
There is a minor oversight however in the scripting. If the user creates the storage secret without a trailing newline, you will end up with delete:
appended to the last line, instead of being added as new line.
Steps to reproduce
Create the registry storage secret as appropriate, without a trailing newline.
Configuration used
s3:\n
...\n
region: eu-central-1
Current behavior
s3:
region: eu-central-1delete:
enabled: true
Expected behavior
s3:
region: eu-central-1
delete:
enabled: true
Versions
- Chart:
v1.3.0
+
Relevant logs
See https://gitlab.com/charts/gitlab/issues/712#note_121329465
configuration error: error parsing /etc/docker/registry/config.yml: yaml: line 29: mapping values are not allowed in this context