Skip to content

Commit d1f04c2

Browse files
committed
Add code comments
Signed-off-by: 蓝宝石的傻话 <[email protected]>
1 parent f7ca990 commit d1f04c2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/options/types.go

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func (r *ResourceSet) Type() string {
108108
// NodeType represents a nodeName to query from.
109109
type NodeType map[string]struct{}
110110

111+
// Set converts a comma-separated string of nodename into a slice and appends it to the NodeList
111112
func (n *NodeType) Set(value string) error {
112113
s := *n
113114
cols := strings.Split(value, ",")
@@ -120,6 +121,7 @@ func (n *NodeType) Set(value string) error {
120121
return nil
121122
}
122123

124+
// AsSlice returns the LabelsAllowList in the form of plain string slice.
123125
func (n NodeType) AsSlice() []string {
124126
cols := make([]string, 0, len(n))
125127
for col := range n {
@@ -132,6 +134,7 @@ func (n NodeType) String() string {
132134
return strings.Join(n.AsSlice(), ",")
133135
}
134136

137+
// Type returns a descriptive string about the NodeList type.
135138
func (n *NodeType) Type() string {
136139
return "string"
137140
}
@@ -150,6 +153,7 @@ func (n *NodeType) GetNodeFieldSelector() string {
150153

151154
}
152155

156+
// NodeValue represents a nodeName to query from.
153157
type NodeValue interface {
154158
GetNodeFieldSelector() string
155159
}

0 commit comments

Comments
 (0)