1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Feature] Allow replace on empty annotations (#644)

This commit is contained in:
Adam Janikowski 2020-10-07 21:06:29 +02:00 committed by GitHub
parent 02f651c019
commit ac5456dbad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -7,6 +7,7 @@
- Fix Upgrade procedure to safely evict pods during upgrade
- Fix Panics in Deployments without authentication
- Fix ChaosMonkey mode
- Allow append on empty annotations
## [1.0.8](https://github.com/arangodb/kube-arangodb/tree/1.0.8) (2020-09-10)
- Fix Volume rotation on AKS

View file

@ -160,6 +160,9 @@ func getFieldPatch(mode api.LabelsMode, section string, expected map[string]stri
case api.LabelsDisabledMode:
break
case api.LabelsAppendMode:
if len(actual) == 0 {
return patch.NewPatch(patch.ItemReplace(patch.NewPath("metadata", section), expected))
}
for e, v := range expected {
if a, ok := actual[e]; !ok {
p.ItemAdd(patch.NewPath("metadata", section, e), v)
@ -168,6 +171,9 @@ func getFieldPatch(mode api.LabelsMode, section string, expected map[string]stri
}
}
case api.LabelsReplaceMode:
if len(actual) == 0 {
return patch.NewPatch(patch.ItemReplace(patch.NewPath("metadata", section), expected))
}
for e, v := range expected {
if a, ok := actual[e]; !ok {
p.ItemAdd(patch.NewPath("metadata", section, e), v)