Skip to content

Commit

Permalink
Add TODO comments to enforce stricter API group checks in Manifest me…
Browse files Browse the repository at this point in the history
…thods

Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
  • Loading branch information
Warashi committed Dec 25, 2024
1 parent 3659381 commit 32708fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/app/pipedv1/plugin/kubernetes/provider/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 32708fd

Please sign in to comment.