From 94ac3b352929c9d6f359ca51e66a34318eaccdf6 Mon Sep 17 00:00:00 2001 From: Steve Kriss Date: Wed, 29 Nov 2017 19:53:48 -0800 Subject: [PATCH] godoc for ResourceSelector Signed-off-by: Steve Kriss --- pkg/backup/item_action.go | 24 +++++++++++++++++++++--- pkg/restore/item_action.go | 24 +++++++++++++++++++++--- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/pkg/backup/item_action.go b/pkg/backup/item_action.go index ab01794e5e..b27793cdd4 100644 --- a/pkg/backup/item_action.go +++ b/pkg/backup/item_action.go @@ -45,9 +45,27 @@ type ResourceIdentifier struct { // included/excluded resources, and a label-selector that can be used // to match a set of items from a cluster. type ResourceSelector struct { + // IncludedNamespaces is a slice of namespace names to match. All + // namespaces in this slice, except those in ExcludedNamespaces, + // will be matched. A nil/empty slice matches all namespaces. IncludedNamespaces []string + // ExcludedNamespaces is a slice of namespace names to exclude. + // All namespaces in IncludedNamespaces, *except* those in + // this slice, will be matched. ExcludedNamespaces []string - IncludedResources []string - ExcludedResources []string - LabelSelector string + // IncludedResources is a slice of resources to match. Resources + // may be specified as full names (e.g. "services") or abbreviations + // (e.g. "svc"). All resources in this slice, except those in + // ExcludedResources, will be matched. A nil/empty slice matches + // all resources. + IncludedResources []string + // ExcludedResources is a slice of resources to exclude. + // Resources may be specified as full names (e.g. "services") or + // abbreviations (e.g. "svc"). All resources in IncludedResources, + // *except* those in this slice, will be matched. + ExcludedResources []string + // LabelSelector is a string representation of a selector to apply + // when matching resources. See "k8s.io/apimachinery/pkg/labels".Parse() + // for details on syntax. + LabelSelector string } diff --git a/pkg/restore/item_action.go b/pkg/restore/item_action.go index 16f437b4c8..58eb161259 100644 --- a/pkg/restore/item_action.go +++ b/pkg/restore/item_action.go @@ -35,9 +35,27 @@ type ItemAction interface { // included/excluded resources, and a label-selector that can be used // to match a set of items from a cluster. type ResourceSelector struct { + // IncludedNamespaces is a slice of namespace names to match. All + // namespaces in this slice, except those in ExcludedNamespaces, + // will be matched. A nil/empty slice matches all namespaces. IncludedNamespaces []string + // ExcludedNamespaces is a slice of namespace names to exclude. + // All namespaces in IncludedNamespaces, *except* those in + // this slice, will be matched. ExcludedNamespaces []string - IncludedResources []string - ExcludedResources []string - LabelSelector string + // IncludedResources is a slice of resources to match. Resources + // may be specified as full names (e.g. "services") or abbreviations + // (e.g. "svc"). All resources in this slice, except those in + // ExcludedResources, will be matched. A nil/empty slice matches + // all resources. + IncludedResources []string + // ExcludedResources is a slice of resources to exclude. + // Resources may be specified as full names (e.g. "services") or + // abbreviations (e.g. "svc"). All resources in IncludedResources, + // *except* those in this slice, will be matched. + ExcludedResources []string + // LabelSelector is a string representation of a selector to apply + // when matching resources. See "k8s.io/apimachinery/pkg/labels".Parse() + // for details on syntax. + LabelSelector string }