Skip to content

Commit 207a606

Browse files
authored
[Bugfix] Remove PDBs if group count is 0 (#1213)
1 parent 7dbd62f commit 207a606

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Change Log
22

33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
4+
- (Bugfix) Remove PDBs if group count is 0
45

56
## [1.2.22](https://github.com/arangodb/kube-arangodb/tree/1.2.22) (2022-12-13)
67
- (Bugfix) Do not manage ports in managed ExternalAccess mode

pkg/deployment/resources/pdbs.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,13 @@ func newPDBV1(minAvail int, deplname string, group api.ServerGroup, owner meta.O
121121
}
122122
}
123123

124-
// ensurePDBForGroup ensure pdb for a specific server group, if wantMinAvail is zero, the PDB is removed and not recreated
124+
// ensurePDBForGroup ensure pdb for a specific server group, if wantMinAvail is zero or less, the PDB is removed and not recreated
125125
func (r *Resources) ensurePDBForGroup(ctx context.Context, group api.ServerGroup, wantedMinAvail int) error {
126+
if wantedMinAvail < 0 {
127+
// Enforce removal
128+
wantedMinAvail = 0
129+
}
130+
126131
deplName := r.context.GetAPIObject().GetName()
127132
pdbName := PDBNameForGroup(deplName, group)
128133
log := r.log.Str("section", "pdb").Str("group", group.AsRole())

0 commit comments

Comments
 (0)