Skip to content

Commit

Permalink
fix(alluxio): should use json tag instaed of yaml tag since we use k8…
Browse files Browse the repository at this point in the history
…s yaml to unmarshal, which only see json tag

Signed-off-by: weixiao-huang <[email protected]>
  • Loading branch information
weixiao-huang authored and huangweixiao committed Mar 22, 2023
1 parent bcf844b commit 0db9a49
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/ddc/alluxio/types_selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (
// that relates the key and values.
type NodeSelectorRequirement struct {
// The label key that the selector applies to.
Key string `yaml:"key,omitempty"`
Key string `json:"key,omitempty"`
// Represents a key's relationship to a set of values.
// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
Operator string `yaml:"operator,omitempty"`
Operator string `json:"operator,omitempty"`
// +optional
Values []string `yaml:"values,omitempty"`
Values []string `json:"values,omitempty"`
}

// NodeSelectorTerm represents expressions and fields required to select nodes.
Expand All @@ -37,15 +37,15 @@ type NodeSelectorRequirement struct {
// The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
type NodeSelectorTerm struct {
// A list of node selector requirements by node's labels.
MatchExpressions []NodeSelectorRequirement `yaml:"matchExpressions"`
MatchExpressions []NodeSelectorRequirement `json:"matchExpressions"`
}

// NodeSelector represents the union of the results of one or more label queries
// over a set of nodes; that is, it represents the OR of the selectors represented
// by the node selector terms.
type NodeSelector struct {
//Required. A list of node selector terms.
NodeSelectorTerms []NodeSelectorTerm `yaml:"nodeSelectorTerms"`
NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms"`
}

type NodeAffinity struct {
Expand All @@ -64,7 +64,7 @@ type NodeAffinity struct {
// at some point during pod execution (e.g. due to an update), the system
// may or may not try to eventually evict the pod from its node.
// +optional
RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector `yaml:"requiredDuringSchedulingIgnoredDuringExecution"`
RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector `json:"requiredDuringSchedulingIgnoredDuringExecution"`
}

func translateCacheToNodeAffinity(dataAffinity *datav1alpha1.CacheableNodeAffinity) (nodeAffinity *NodeAffinity) {
Expand Down

0 comments on commit 0db9a49

Please sign in to comment.