diff --git a/pkg/options/types.go b/pkg/options/types.go index d7a9b5b185..9f03ec863b 100644 --- a/pkg/options/types.go +++ b/pkg/options/types.go @@ -108,6 +108,7 @@ func (r *ResourceSet) Type() string { // NodeType represents a nodeName to query from. type NodeType map[string]struct{} +// Set converts a comma-separated string of nodename into a slice and appends it to the NodeList func (n *NodeType) Set(value string) error { s := *n cols := strings.Split(value, ",") @@ -120,6 +121,7 @@ func (n *NodeType) Set(value string) error { return nil } +// AsSlice returns the LabelsAllowList in the form of plain string slice. func (n NodeType) AsSlice() []string { cols := make([]string, 0, len(n)) for col := range n { @@ -132,6 +134,7 @@ func (n NodeType) String() string { return strings.Join(n.AsSlice(), ",") } +// Type returns a descriptive string about the NodeList type. func (n *NodeType) Type() string { return "string" } @@ -150,6 +153,7 @@ func (n *NodeType) GetNodeFieldSelector() string { } +// NodeValue represents a nodeName to query from. type NodeValue interface { GetNodeFieldSelector() string }