From 0db9a49fabf37aec7263ad440311e793268d9696 Mon Sep 17 00:00:00 2001 From: weixiao-huang Date: Wed, 22 Mar 2023 10:42:56 +0800 Subject: [PATCH] fix(alluxio): should use json tag instaed of yaml tag since we use k8s yaml to unmarshal, which only see json tag Signed-off-by: weixiao-huang --- pkg/ddc/alluxio/types_selector.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/ddc/alluxio/types_selector.go b/pkg/ddc/alluxio/types_selector.go index e4ac37bce5c..4f7c27fdec2 100644 --- a/pkg/ddc/alluxio/types_selector.go +++ b/pkg/ddc/alluxio/types_selector.go @@ -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. @@ -37,7 +37,7 @@ 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 @@ -45,7 +45,7 @@ type NodeSelectorTerm struct { // 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 { @@ -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) {