Add code comments
Signed-off-by: 蓝宝石的傻话 <mickey_zzc@163.com>
This commit is contained in:
parent
f7ca9909df
commit
d1f04c2479
|
|
@ -108,6 +108,7 @@ func (r *ResourceSet) Type() string {
|
||||||
// NodeType represents a nodeName to query from.
|
// NodeType represents a nodeName to query from.
|
||||||
type NodeType map[string]struct{}
|
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 {
|
func (n *NodeType) Set(value string) error {
|
||||||
s := *n
|
s := *n
|
||||||
cols := strings.Split(value, ",")
|
cols := strings.Split(value, ",")
|
||||||
|
|
@ -120,6 +121,7 @@ func (n *NodeType) Set(value string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AsSlice returns the LabelsAllowList in the form of plain string slice.
|
||||||
func (n NodeType) AsSlice() []string {
|
func (n NodeType) AsSlice() []string {
|
||||||
cols := make([]string, 0, len(n))
|
cols := make([]string, 0, len(n))
|
||||||
for col := range n {
|
for col := range n {
|
||||||
|
|
@ -132,6 +134,7 @@ func (n NodeType) String() string {
|
||||||
return strings.Join(n.AsSlice(), ",")
|
return strings.Join(n.AsSlice(), ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Type returns a descriptive string about the NodeList type.
|
||||||
func (n *NodeType) Type() string {
|
func (n *NodeType) Type() string {
|
||||||
return "string"
|
return "string"
|
||||||
}
|
}
|
||||||
|
|
@ -150,6 +153,7 @@ func (n *NodeType) GetNodeFieldSelector() string {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NodeValue represents a nodeName to query from.
|
||||||
type NodeValue interface {
|
type NodeValue interface {
|
||||||
GetNodeFieldSelector() string
|
GetNodeFieldSelector() string
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue