Add code comments

Signed-off-by: 蓝宝石的傻话 <mickey_zzc@163.com>
This commit is contained in:
蓝宝石的傻话 2023-10-20 23:10:16 +08:00
parent f7ca9909df
commit d1f04c2479
1 changed files with 4 additions and 0 deletions

View File

@ -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
}