Skip to content

Commit

Permalink
Add code comments
Browse files Browse the repository at this point in the history
Signed-off-by: 蓝宝石的傻话 <mickey_zzc@163.com>
  • Loading branch information
mickeyzzc committed Oct 20, 2023
1 parent f7ca990 commit d1f04c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/options/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, ",")
Expand All @@ -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 {
Expand All @@ -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"
}
Expand All @@ -150,6 +153,7 @@ func (n *NodeType) GetNodeFieldSelector() string {

}

// NodeValue represents a nodeName to query from.
type NodeValue interface {
GetNodeFieldSelector() string
}
Expand Down

0 comments on commit d1f04c2

Please sign in to comment.