mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-18 20:17:04 +00:00
feat: security measures and prometheusrules (#1995)
* 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> * fix: preserve ca-bundles injected from external providers Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * feat: add metadata enforcement Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * feat: add metadata enforcement Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * fix: add resourcepoolclaim validation Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * fix: add resourcepoolclaim validation Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * fix: add resourcepoolclaim validation Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: add resourcepoolclaim validation Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * feat: security measures and prometheusrules Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * feat: security measures and prometheusrules Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * feat: security measures and prometheusrules Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * feat: security measures and prometheusrules Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * feat: security measures and prometheusrules Signed-off-by: Oliver Baehler <oliver@sudo-i.net> * feat: security measures and prometheusrules Signed-off-by: Oliver Baehler <oliver@sudo-i.net> --------- Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> Signed-off-by: Oliver Baehler <oliver@sudo-i.net> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI
parent
8526d84500
commit
6a762e7899
@@ -128,21 +128,27 @@ func (t ResourceReference) LoadResources(
|
||||
func (t ResourceReference) IsNamespacedGVK(
|
||||
restMapper k8smeta.RESTMapper,
|
||||
) (bool, error) {
|
||||
gv, err := schema.ParseGroupVersion(t.APIVersion)
|
||||
return IsNamespacedGVK(restMapper, t.APIVersion, t.Kind)
|
||||
}
|
||||
|
||||
func IsNamespacedGVK(
|
||||
restMapper k8smeta.RESTMapper,
|
||||
apiVersion string,
|
||||
kind string,
|
||||
) (bool, error) {
|
||||
gv, err := schema.ParseGroupVersion(apiVersion)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("invalid apiVersion %q: %w", t.APIVersion, err)
|
||||
return false, fmt.Errorf("invalid apiVersion %q: %w", apiVersion, err)
|
||||
}
|
||||
|
||||
gvk := gv.WithKind(t.Kind)
|
||||
gvk := gv.WithKind(kind)
|
||||
|
||||
mapping, err := restMapper.RESTMapping(gvk.GroupKind(), gvk.Version)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to resolve GVK %s: %w", gvk.String(), err)
|
||||
}
|
||||
|
||||
isNamespaced := mapping.Scope.Name() == k8smeta.RESTScopeNameNamespace
|
||||
|
||||
return isNamespaced, nil
|
||||
return mapping.Scope.Name() == k8smeta.RESTScopeNameNamespace, nil
|
||||
}
|
||||
|
||||
func (t ResourceReference) loadResources(
|
||||
|
||||
Reference in New Issue
Block a user