mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-18 20:17:04 +00:00
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:
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -50,6 +50,7 @@ func IsCapsuleUser(
|
||||
}
|
||||
}
|
||||
|
||||
//nolint:modernize
|
||||
for _, group := range cfg.UserGroups() {
|
||||
if groupList.Find(group) {
|
||||
if len(cfg.IgnoreUserWithGroups()) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user