@@ -23,7 +23,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323// **OR** of the selector terms.
2424type ResourceSelector struct {
2525 // A list of selector terms. This list of terms are ORed.
26- SelectorTerms []* SelectorTerm `json:"selectorTerms"`
26+ SelectorTerms []* SelectorTerm `json:"selectorTerms,omitempty "`
2727}
2828
2929// A SelectorTerm is a query over various match representations.
@@ -60,14 +60,14 @@ type SelectorTerm struct {
6060 // or not.
6161 //
6262 // This is optional
63- MatchSlice map [string ][]string `json:"matchSlice"`
63+ MatchSlice map [string ][]string `json:"matchSlice,omitempty "`
6464
6565 // MatchSliceExpressions is a list of slice selector requirements.
6666 // These requirements are AND-ed to determine if the selector matches
6767 // its target or not.
6868 //
6969 // This is optional
70- MatchSliceExpressions []SliceSelectorRequirement `json:"matchSliceExpressions"`
70+ MatchSliceExpressions []SliceSelectorRequirement `json:"matchSliceExpressions,omitempty "`
7171
7272 // MatchFields is a map i.e. key value pairs based field selector.
7373 //
@@ -102,13 +102,13 @@ type SelectorTerm struct {
102102 // not.
103103 //
104104 // This is optional
105- MatchFields map [string ]string `json:"matchFields"`
105+ MatchFields map [string ]string `json:"matchFields,omitempty "`
106106
107107 // MatchFieldExpressions is a list of field selector requirements.
108108 // The requirements are AND-ed.
109109 //
110110 // This is optional
111- MatchFieldExpressions []metav1.LabelSelectorRequirement `json:"matchFieldExpressions"`
111+ MatchFieldExpressions []metav1.LabelSelectorRequirement `json:"matchFieldExpressions,omitempty "`
112112
113113 // MatchReference is a list of keys where each key holds the
114114 // path to a nested field present in both target resource as
@@ -152,13 +152,13 @@ type SelectorTerm struct {
152152 // extracted from these objects match.
153153 //
154154 // This is optional
155- MatchReference []string `json:"matchReference"`
155+ MatchReference []string `json:"matchReference,omitempty "`
156156
157157 // MatchReferenceExpressions is a list of field selector requirements.
158158 // The requirements are AND-ed.
159159 //
160160 // This is optional
161- MatchReferenceExpressions []ReferenceSelectorRequirement `json:"matchReferenceExpressions"`
161+ MatchReferenceExpressions []ReferenceSelectorRequirement `json:"matchReferenceExpressions,omitempty "`
162162
163163 // MatchLabels is a map of {key,value} pairs that is matched against
164164 // the target's labels.
@@ -188,13 +188,13 @@ type SelectorTerm struct {
188188 // considered as a successful match.
189189 //
190190 // This is optional
191- MatchLabels map [string ]string `json:"matchLabels"`
191+ MatchLabels map [string ]string `json:"matchLabels,omitempty "`
192192
193193 // MatchLabelExpressions is a list of label selector requirements.
194194 // The requirements are ANDed.
195195 //
196196 // This is optional
197- MatchLabelExpressions []metav1.LabelSelectorRequirement `json:"matchLabelExpressions"`
197+ MatchLabelExpressions []metav1.LabelSelectorRequirement `json:"matchLabelExpressions,omitempty "`
198198
199199 // MatchAnnotations is a map of {key,value} pairs that is matched against
200200 // the target's annotations.
@@ -224,15 +224,15 @@ type SelectorTerm struct {
224224 // considered as a successful match.
225225 //
226226 // This is optional
227- MatchAnnotations map [string ]string `json:"matchAnnotations"`
227+ MatchAnnotations map [string ]string `json:"matchAnnotations,omitempty "`
228228
229229 // MatchAnnotationExpressions is a list of label selector requirements.
230230 // The requirements are ANDed.
231231 //
232232 // The key as well value is matched against the target's annotations.
233233 //
234234 // This is optional
235- MatchAnnotationExpressions []metav1.LabelSelectorRequirement `json:"matchAnnotationExpressions"`
235+ MatchAnnotationExpressions []metav1.LabelSelectorRequirement `json:"matchAnnotationExpressions,omitempty "`
236236}
237237
238238// SliceSelectorRequirement contains values, a key, and an operator that
@@ -303,7 +303,7 @@ type ReferenceSelectorRequirement struct {
303303 // NOTE:
304304 // When set, the Operator field becomes optional since Operator
305305 // is set to Equals.
306- RefKey string `json:"refKey"`
306+ RefKey string `json:"refKey,omitempty "`
307307
308308 // Operator represents the operation that will be undertaken
309309 // between the values extracted from target & reference. Both
0 commit comments