|
1 | | -use std::collections::BTreeMap; |
2 | | - |
| 1 | +use fleet_api_rs::fleet_bundle_namespace_mapping::{ |
| 2 | + BundleNamespaceMappingBundleSelector, BundleNamespaceMappingNamespaceSelector, |
| 3 | +}; |
3 | 4 | use kube::{ |
4 | 5 | api::{ObjectMeta, TypeMeta}, |
5 | 6 | Resource, |
6 | 7 | }; |
7 | | -use schemars::JsonSchema; |
8 | 8 | use serde::{Deserialize, Serialize}; |
9 | 9 |
|
10 | 10 | mod mapping { |
@@ -32,83 +32,3 @@ pub struct BundleNamespaceMapping { |
32 | 32 | pub bundle_selector: BundleNamespaceMappingBundleSelector, |
33 | 33 | pub namespace_selector: BundleNamespaceMappingNamespaceSelector, |
34 | 34 | } |
35 | | - |
36 | | -/// A label selector is a label query over a set of resources. The result of matchLabels and |
37 | | -/// matchExpressions are ANDed. An empty label selector matches all objects. A null |
38 | | -/// label selector matches no objects. |
39 | | -#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)] |
40 | | -pub struct BundleNamespaceMappingBundleSelector { |
41 | | - /// matchExpressions is a list of label selector requirements. The requirements are ANDed. |
42 | | - #[serde( |
43 | | - default, |
44 | | - skip_serializing_if = "Option::is_none", |
45 | | - rename = "matchExpressions" |
46 | | - )] |
47 | | - pub match_expressions: Option<Vec<BundleNamespaceMappingBundleSelectorMatchExpressions>>, |
48 | | - /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels |
49 | | - /// map is equivalent to an element of matchExpressions, whose key field is "key", the |
50 | | - /// operator is "In", and the values array contains only "value". The requirements are ANDed. |
51 | | - #[serde( |
52 | | - default, |
53 | | - skip_serializing_if = "Option::is_none", |
54 | | - rename = "matchLabels" |
55 | | - )] |
56 | | - pub match_labels: Option<BTreeMap<String, String>>, |
57 | | -} |
58 | | - |
59 | | -/// A label selector requirement is a selector that contains values, a key, and an operator that |
60 | | -/// relates the key and values. |
61 | | -#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)] |
62 | | -pub struct BundleNamespaceMappingBundleSelectorMatchExpressions { |
63 | | - /// key is the label key that the selector applies to. |
64 | | - pub key: String, |
65 | | - /// operator represents a key's relationship to a set of values. |
66 | | - /// Valid operators are In, NotIn, Exists and DoesNotExist. |
67 | | - pub operator: String, |
68 | | - /// values is an array of string values. If the operator is In or NotIn, |
69 | | - /// the values array must be non-empty. If the operator is Exists or DoesNotExist, |
70 | | - /// the values array must be empty. This array is replaced during a strategic |
71 | | - /// merge patch. |
72 | | - #[serde(default, skip_serializing_if = "Option::is_none")] |
73 | | - pub values: Option<Vec<String>>, |
74 | | -} |
75 | | - |
76 | | -/// A label selector is a label query over a set of resources. The result of matchLabels and |
77 | | -/// matchExpressions are ANDed. An empty label selector matches all objects. A null |
78 | | -/// label selector matches no objects. |
79 | | -#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)] |
80 | | -pub struct BundleNamespaceMappingNamespaceSelector { |
81 | | - /// matchExpressions is a list of label selector requirements. The requirements are ANDed. |
82 | | - #[serde( |
83 | | - default, |
84 | | - skip_serializing_if = "Option::is_none", |
85 | | - rename = "matchExpressions" |
86 | | - )] |
87 | | - pub match_expressions: Option<Vec<BundleNamespaceMappingNamespaceSelectorMatchExpressions>>, |
88 | | - /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels |
89 | | - /// map is equivalent to an element of matchExpressions, whose key field is "key", the |
90 | | - /// operator is "In", and the values array contains only "value". The requirements are ANDed. |
91 | | - #[serde( |
92 | | - default, |
93 | | - skip_serializing_if = "Option::is_none", |
94 | | - rename = "matchLabels" |
95 | | - )] |
96 | | - pub match_labels: Option<BTreeMap<String, String>>, |
97 | | -} |
98 | | - |
99 | | -/// A label selector requirement is a selector that contains values, a key, and an operator that |
100 | | -/// relates the key and values. |
101 | | -#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)] |
102 | | -pub struct BundleNamespaceMappingNamespaceSelectorMatchExpressions { |
103 | | - /// key is the label key that the selector applies to. |
104 | | - pub key: String, |
105 | | - /// operator represents a key's relationship to a set of values. |
106 | | - /// Valid operators are In, NotIn, Exists and DoesNotExist. |
107 | | - pub operator: String, |
108 | | - /// values is an array of string values. If the operator is In or NotIn, |
109 | | - /// the values array must be non-empty. If the operator is Exists or DoesNotExist, |
110 | | - /// the values array must be empty. This array is replaced during a strategic |
111 | | - /// merge patch. |
112 | | - #[serde(default, skip_serializing_if = "Option::is_none")] |
113 | | - pub values: Option<Vec<String>>, |
114 | | -} |
0 commit comments