fix(controller): decode old object for delete requests (#1787)

* fix(controller): decode old object for delete requests

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* chore: modernize golang

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* chore: modernize golang

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* chore: modernize golang

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

---------

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
This commit is contained in:
Oliver Bähler
2025-12-10 18:34:42 +01:00
committed by GitHub
parent cd5e2a82e1
commit c06f54a3a3
34 changed files with 217 additions and 183 deletions
+4 -2
View File
@@ -10,7 +10,9 @@ import (
// +kubebuilder:object:generate=true
type PoolExhaustionResource struct {
// Available Resources to be claimed
Available resource.Quantity `json:"available,omitempty"`
// +optional
Available resource.Quantity `json:"available,omitzero"`
// Requesting Resources
Requesting resource.Quantity `json:"requesting,omitempty"`
// +optional
Requesting resource.Quantity `json:"requesting,omitzero"`
}
+3 -4
View File
@@ -4,6 +4,7 @@
package api
import (
"slices"
"sort"
)
@@ -19,10 +20,8 @@ func (o OwnerListSpec) IsOwner(name string, groups []string) bool {
return true
}
case GroupOwner:
for _, group := range groups {
if group == owner.Name {
return true
}
if slices.Contains(groups, owner.Name) {
return true
}
}
}
+4 -2
View File
@@ -13,7 +13,9 @@ type ServiceOptions struct {
// Specifies the external IPs that can be used in Services with type ClusterIP. An empty list means no IPs are allowed. Optional.
ExternalServiceIPs *ExternalServiceIPsSpec `json:"externalIPs,omitempty"`
// Define the labels that a Tenant Owner cannot set for their Service resources.
ForbiddenLabels ForbiddenListSpec `json:"forbiddenLabels,omitempty"`
// +optional
ForbiddenLabels ForbiddenListSpec `json:"forbiddenLabels,omitzero"`
// Define the annotations that a Tenant Owner cannot set for their Service resources.
ForbiddenAnnotations ForbiddenListSpec `json:"forbiddenAnnotations,omitempty"`
// +optional
ForbiddenAnnotations ForbiddenListSpec `json:"forbiddenAnnotations,omitzero"`
}
+1 -1
View File
@@ -20,7 +20,7 @@ func TemplateForTenantAndNamespace(m map[string]string, tnt *capsulev1beta2.Tena
}
t := fasttemplate.New(v, "{{ ", " }}")
tmplString := t.ExecuteString(map[string]interface{}{
tmplString := t.ExecuteString(map[string]any{
"tenant.name": tnt.Name,
"namespace": ns.Name,
})
+1
View File
@@ -50,6 +50,7 @@ func IsCapsuleUser(
}
}
//nolint:modernize
for _, group := range cfg.UserGroups() {
if groupList.Find(group) {
if len(cfg.IgnoreUserWithGroups()) > 0 {