Skip to content

Commit

Permalink
Add comments to ResourceKey
Browse files Browse the repository at this point in the history
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
  • Loading branch information
Warashi committed Dec 27, 2024
1 parent 48c0fb3 commit 6fb0aab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/app/pipedv1/plugin/kubernetes/provider/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,18 @@ const (
DefaultNamespace = "default"
)

// ResourceKey represents a unique key of a Kubernetes resource.
// We use GroupKind, namespace, and name to identify a resource.
type ResourceKey struct {
// We use GroupKind instead of GroupVersionKind because we don't care about the version.
groupKind schema.GroupKind
// The namespace of the resource.
// We use namespace as a part of the key to identify a resource
// We have to distinguish the namespaces to prune the old resource when users change the namespace of a resource.
// If the resource is cluster-scoped, this field should be empty.
namespace string
name string
// The name of the resource.
name string
}

func (k ResourceKey) Kind() string {
Expand Down

0 comments on commit 6fb0aab

Please sign in to comment.