From 32708fdd5c7af50b42c139e5c04b64f9b7adbf02 Mon Sep 17 00:00:00 2001 From: Shinnosuke Sawada-Dazai Date: Wed, 25 Dec 2024 11:38:29 +0900 Subject: [PATCH] Add TODO comments to enforce stricter API group checks in Manifest methods Signed-off-by: Shinnosuke Sawada-Dazai --- pkg/app/pipedv1/plugin/kubernetes/provider/manifest.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/app/pipedv1/plugin/kubernetes/provider/manifest.go b/pkg/app/pipedv1/plugin/kubernetes/provider/manifest.go index c67be94969..d964c332eb 100644 --- a/pkg/app/pipedv1/plugin/kubernetes/provider/manifest.go +++ b/pkg/app/pipedv1/plugin/kubernetes/provider/manifest.go @@ -62,18 +62,21 @@ func (m Manifest) Key() ResourceKey { // IsDeployment returns true if the manifest is a Deployment. // It checks the API group and the kind of the manifest. func (m Manifest) IsDeployment() bool { + // TODO: check the API group more strictly. return isBuiltinAPIGroup(m.body.GroupVersionKind().Group) && m.body.GetKind() == KindDeployment } // IsSecret returns true if the manifest is a Secret. // It checks the API group and the kind of the manifest. func (m Manifest) IsSecret() bool { + // TODO: check the API group more strictly. return isBuiltinAPIGroup(m.body.GroupVersionKind().Group) && m.body.GetKind() == KindSecret } // IsConfigMap returns true if the manifest is a ConfigMap. // It checks the API group and the kind of the manifest. func (m Manifest) IsConfigMap() bool { + // TODO: check the API group more strictly. return isBuiltinAPIGroup(m.body.GroupVersionKind().Group) && m.body.GetKind() == KindConfigMap }