Skip to content

Commit

Permalink
fix annotations getting overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
kroonprins committed Jan 30, 2023
1 parent 9ddb0b4 commit 6ea729e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/core/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func getMetaData(secretTemplate *types.SecretTemplate) (*v1.ObjectMeta, error) {
secretTemplate.Spec.ObjectMeta.DeepCopyInto(res)

var annotations = make(map[string]string)
for k, v := range secretTemplate.ObjectMeta.GetAnnotations() {
for k, v := range secretTemplate.Spec.ObjectMeta.GetAnnotations() {
annotations[k] = v
}
annotations[constants.ANNOTATION] = string(bytes)
Expand Down
4 changes: 4 additions & 0 deletions samples/test-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ spec:
metadata:
name: created-file-secret-1
namespace: kube-system
labels:
test-label: foo
annotations:
test-annotation: bar
data:
FILE_1_CONTENT: ref+file://files/test-file-1.txt
FILE_2_CONTENT: ref+file://files/test-file-2.txt
Expand Down

0 comments on commit 6ea729e

Please sign in to comment.