Skip to content

Commit

Permalink
Fix for Orange (#1158)
Browse files Browse the repository at this point in the history
Signed-off-by: souravbiswassanto <[email protected]>
  • Loading branch information
souravbiswassanto authored Feb 22, 2024
1 parent 000dfa1 commit ed8ce7c
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions apis/kubedb/v1alpha2/postgres_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,26 +340,6 @@ func (p *Postgres) setDefaultCapabilitiesForPostgres(sc *core.SecurityContext) {
sc.Capabilities = &core.Capabilities{
Add: []core.Capability{IPS_LOCK, SYS_RESOURCE},
}
} else {
newCapabilities := &core.Capabilities{}
caps := []core.Capability{IPS_LOCK, SYS_RESOURCE}
if sc.Capabilities.Add == nil {
newCapabilities.Add = caps
} else {
newCapabilities.Add = sc.Capabilities.Add
for i := range caps {
found := false
for _, capability := range sc.Capabilities.Add {
if caps[i] == capability {
found = true
}
}
if !found {
newCapabilities.Add = append(newCapabilities.Add, caps[i])
}
}
}
sc.Capabilities = newCapabilities
}
}

Expand Down

0 comments on commit ed8ce7c

Please sign in to comment.