Commit 0a896a9e authored by Chao Xu's avatar Chao Xu

remove versioned LabelSelector definitions

parent d5668d62
...@@ -30272,7 +30272,7 @@ ...@@ -30272,7 +30272,7 @@
}, },
"selector": { "selector": {
"description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors", "description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors",
"$ref": "#/definitions/v1.LabelSelector" "$ref": "#/definitions/unversioned.LabelSelector"
}, },
"template": { "template": {
"description": "Template is the object that describes the pod that will be created when executing a job. More info: http://kubernetes.io/docs/user-guide/jobs", "description": "Template is the object that describes the pod that will be created when executing a job. More info: http://kubernetes.io/docs/user-guide/jobs",
...@@ -30315,49 +30315,6 @@ ...@@ -30315,49 +30315,6 @@
} }
} }
}, },
"v1.LabelSelector": {
"description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
"properties": {
"matchExpressions": {
"description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
"type": "array",
"items": {
"$ref": "#/definitions/v1.LabelSelectorRequirement"
}
},
"matchLabels": {
"description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
"v1.LabelSelectorRequirement": {
"description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
"required": [
"key",
"operator"
],
"properties": {
"key": {
"description": "key is the label key that the selector applies to.",
"type": "string"
},
"operator": {
"description": "operator represents a key's relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist.",
"type": "string"
},
"values": {
"description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"v1.Lifecycle": { "v1.Lifecycle": {
"description": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", "description": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.",
"properties": { "properties": {
...@@ -32652,7 +32609,7 @@ ...@@ -32652,7 +32609,7 @@
"properties": { "properties": {
"selector": { "selector": {
"description": "Selector is a label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors", "description": "Selector is a label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors",
"$ref": "#/definitions/v1beta1.LabelSelector" "$ref": "#/definitions/unversioned.LabelSelector"
}, },
"template": { "template": {
"description": "Template is the object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template", "description": "Template is the object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template",
...@@ -32782,7 +32739,7 @@ ...@@ -32782,7 +32739,7 @@
}, },
"selector": { "selector": {
"description": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.", "description": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.",
"$ref": "#/definitions/v1beta1.LabelSelector" "$ref": "#/definitions/unversioned.LabelSelector"
}, },
"strategy": { "strategy": {
"description": "The deployment strategy to use to replace existing pods with new ones.", "description": "The deployment strategy to use to replace existing pods with new ones.",
...@@ -33139,7 +33096,7 @@ ...@@ -33139,7 +33096,7 @@
}, },
"selector": { "selector": {
"description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors", "description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors",
"$ref": "#/definitions/v1beta1.LabelSelector" "$ref": "#/definitions/unversioned.LabelSelector"
}, },
"template": { "template": {
"description": "Template is the object that describes the pod that will be created when executing a job. More info: http://kubernetes.io/docs/user-guide/jobs", "description": "Template is the object that describes the pod that will be created when executing a job. More info: http://kubernetes.io/docs/user-guide/jobs",
...@@ -33182,49 +33139,6 @@ ...@@ -33182,49 +33139,6 @@
} }
} }
}, },
"v1beta1.LabelSelector": {
"description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
"properties": {
"matchExpressions": {
"description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
"type": "array",
"items": {
"$ref": "#/definitions/v1beta1.LabelSelectorRequirement"
}
},
"matchLabels": {
"description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
"v1beta1.LabelSelectorRequirement": {
"description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
"required": [
"key",
"operator"
],
"properties": {
"key": {
"description": "key is the label key that the selector applies to.",
"type": "string"
},
"operator": {
"description": "operator represents a key's relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist.",
"type": "string"
},
"values": {
"description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"v1beta1.LocalSubjectAccessReview": { "v1beta1.LocalSubjectAccessReview": {
"description": "LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.", "description": "LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.",
"required": [ "required": [
...@@ -33298,11 +33212,11 @@ ...@@ -33298,11 +33212,11 @@
"properties": { "properties": {
"namespaceSelector": { "namespaceSelector": {
"description": "Selects Namespaces using cluster scoped-labels. This matches all pods in all namespaces selected by this label selector. This field follows standard label selector semantics. If omitted, this selector selects no namespaces. If present but empty, this selector selects all namespaces.", "description": "Selects Namespaces using cluster scoped-labels. This matches all pods in all namespaces selected by this label selector. This field follows standard label selector semantics. If omitted, this selector selects no namespaces. If present but empty, this selector selects all namespaces.",
"$ref": "#/definitions/v1beta1.LabelSelector" "$ref": "#/definitions/unversioned.LabelSelector"
}, },
"podSelector": { "podSelector": {
"description": "This is a label selector which selects Pods in this namespace. This field follows standard label selector semantics. If not provided, this selector selects no pods. If present but empty, this selector selects all pods in this namespace.", "description": "This is a label selector which selects Pods in this namespace. This field follows standard label selector semantics. If not provided, this selector selects no pods. If present but empty, this selector selects all pods in this namespace.",
"$ref": "#/definitions/v1beta1.LabelSelector" "$ref": "#/definitions/unversioned.LabelSelector"
} }
} }
}, },
...@@ -33332,7 +33246,7 @@ ...@@ -33332,7 +33246,7 @@
}, },
"podSelector": { "podSelector": {
"description": "Selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace.", "description": "Selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace.",
"$ref": "#/definitions/v1beta1.LabelSelector" "$ref": "#/definitions/unversioned.LabelSelector"
} }
} }
}, },
...@@ -33429,7 +33343,7 @@ ...@@ -33429,7 +33343,7 @@
}, },
"selector": { "selector": {
"description": "Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors", "description": "Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors",
"$ref": "#/definitions/v1beta1.LabelSelector" "$ref": "#/definitions/unversioned.LabelSelector"
}, },
"template": { "template": {
"description": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template", "description": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template",
......
...@@ -1179,7 +1179,7 @@ ...@@ -1179,7 +1179,7 @@
"description": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer" "description": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer"
}, },
"selector": { "selector": {
"$ref": "v1.LabelSelector", "$ref": "unversioned.LabelSelector",
"description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors" "description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors"
}, },
"manualSelector": { "manualSelector": {
...@@ -1192,8 +1192,8 @@ ...@@ -1192,8 +1192,8 @@
} }
} }
}, },
"v1.LabelSelector": { "unversioned.LabelSelector": {
"id": "v1.LabelSelector", "id": "unversioned.LabelSelector",
"description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
"properties": { "properties": {
"matchLabels": { "matchLabels": {
...@@ -1203,14 +1203,14 @@ ...@@ -1203,14 +1203,14 @@
"matchExpressions": { "matchExpressions": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "v1.LabelSelectorRequirement" "$ref": "unversioned.LabelSelectorRequirement"
}, },
"description": "matchExpressions is a list of label selector requirements. The requirements are ANDed." "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed."
} }
} }
}, },
"v1.LabelSelectorRequirement": { "unversioned.LabelSelectorRequirement": {
"id": "v1.LabelSelectorRequirement", "id": "unversioned.LabelSelectorRequirement",
"description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
"required": [ "required": [
"key", "key",
......
...@@ -7792,7 +7792,7 @@ ...@@ -7792,7 +7792,7 @@
], ],
"properties": { "properties": {
"selector": { "selector": {
"$ref": "v1beta1.LabelSelector", "$ref": "unversioned.LabelSelector",
"description": "Selector is a label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors" "description": "Selector is a label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors"
}, },
"template": { "template": {
...@@ -7801,8 +7801,8 @@ ...@@ -7801,8 +7801,8 @@
} }
} }
}, },
"v1beta1.LabelSelector": { "unversioned.LabelSelector": {
"id": "v1beta1.LabelSelector", "id": "unversioned.LabelSelector",
"description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
"properties": { "properties": {
"matchLabels": { "matchLabels": {
...@@ -7812,14 +7812,14 @@ ...@@ -7812,14 +7812,14 @@
"matchExpressions": { "matchExpressions": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "v1beta1.LabelSelectorRequirement" "$ref": "unversioned.LabelSelectorRequirement"
}, },
"description": "matchExpressions is a list of label selector requirements. The requirements are ANDed." "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed."
} }
} }
}, },
"v1beta1.LabelSelectorRequirement": { "unversioned.LabelSelectorRequirement": {
"id": "v1beta1.LabelSelectorRequirement", "id": "unversioned.LabelSelectorRequirement",
"description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
"required": [ "required": [
"key", "key",
...@@ -9426,7 +9426,7 @@ ...@@ -9426,7 +9426,7 @@
"description": "Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1." "description": "Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1."
}, },
"selector": { "selector": {
"$ref": "v1beta1.LabelSelector", "$ref": "unversioned.LabelSelector",
"description": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment." "description": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment."
}, },
"template": { "template": {
...@@ -10040,7 +10040,7 @@ ...@@ -10040,7 +10040,7 @@
"description": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer" "description": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer"
}, },
"selector": { "selector": {
"$ref": "v1beta1.LabelSelector", "$ref": "unversioned.LabelSelector",
"description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors" "description": "Selector is a label query over pods that should match the pod count. Normally, the system sets this field for you. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors"
}, },
"autoSelector": { "autoSelector": {
...@@ -10183,7 +10183,7 @@ ...@@ -10183,7 +10183,7 @@
], ],
"properties": { "properties": {
"podSelector": { "podSelector": {
"$ref": "v1beta1.LabelSelector", "$ref": "unversioned.LabelSelector",
"description": "Selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace." "description": "Selects the pods to which this NetworkPolicy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace."
}, },
"ingress": { "ingress": {
...@@ -10236,11 +10236,11 @@ ...@@ -10236,11 +10236,11 @@
"id": "v1beta1.NetworkPolicyPeer", "id": "v1beta1.NetworkPolicyPeer",
"properties": { "properties": {
"podSelector": { "podSelector": {
"$ref": "v1beta1.LabelSelector", "$ref": "unversioned.LabelSelector",
"description": "This is a label selector which selects Pods in this namespace. This field follows standard label selector semantics. If not provided, this selector selects no pods. If present but empty, this selector selects all pods in this namespace." "description": "This is a label selector which selects Pods in this namespace. This field follows standard label selector semantics. If not provided, this selector selects no pods. If present but empty, this selector selects all pods in this namespace."
}, },
"namespaceSelector": { "namespaceSelector": {
"$ref": "v1beta1.LabelSelector", "$ref": "unversioned.LabelSelector",
"description": "Selects Namespaces using cluster scoped-labels. This matches all pods in all namespaces selected by this label selector. This field follows standard label selector semantics. If omitted, this selector selects no namespaces. If present but empty, this selector selects all namespaces." "description": "Selects Namespaces using cluster scoped-labels. This matches all pods in all namespaces selected by this label selector. This field follows standard label selector semantics. If omitted, this selector selects no namespaces. If present but empty, this selector selects all namespaces."
} }
} }
...@@ -10314,7 +10314,7 @@ ...@@ -10314,7 +10314,7 @@
"description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)" "description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)"
}, },
"selector": { "selector": {
"$ref": "v1beta1.LabelSelector", "$ref": "unversioned.LabelSelector",
"description": "Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors" "description": "Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors"
}, },
"template": { "template": {
......
...@@ -44,6 +44,7 @@ go_test( ...@@ -44,6 +44,7 @@ go_test(
"//federation/client/clientset_generated/federation_release_1_5/fake:go_default_library", "//federation/client/clientset_generated/federation_release_1_5/fake:go_default_library",
"//federation/pkg/federation-controller/util:go_default_library", "//federation/pkg/federation-controller/util:go_default_library",
"//federation/pkg/federation-controller/util/test:go_default_library", "//federation/pkg/federation-controller/util/test:go_default_library",
"//pkg/api/unversioned:go_default_library",
"//pkg/api/v1:go_default_library", "//pkg/api/v1:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library", "//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/client/clientset_generated/release_1_5:go_default_library", "//pkg/client/clientset_generated/release_1_5:go_default_library",
......
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
fake_fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_5/fake" fake_fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_5/fake"
"k8s.io/kubernetes/federation/pkg/federation-controller/util" "k8s.io/kubernetes/federation/pkg/federation-controller/util"
. "k8s.io/kubernetes/federation/pkg/federation-controller/util/test" . "k8s.io/kubernetes/federation/pkg/federation-controller/util/test"
"k8s.io/kubernetes/pkg/api/unversioned"
api_v1 "k8s.io/kubernetes/pkg/api/v1" api_v1 "k8s.io/kubernetes/pkg/api/v1"
extensionsv1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" extensionsv1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5" kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5"
...@@ -85,7 +86,7 @@ func TestDaemonSetController(t *testing.T) { ...@@ -85,7 +86,7 @@ func TestDaemonSetController(t *testing.T) {
SelfLink: "/api/v1/namespaces/ns/daemonsets/test-daemonset", SelfLink: "/api/v1/namespaces/ns/daemonsets/test-daemonset",
}, },
Spec: extensionsv1.DaemonSetSpec{ Spec: extensionsv1.DaemonSetSpec{
Selector: &extensionsv1.LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: make(map[string]string), MatchLabels: make(map[string]string),
}, },
}, },
......
...@@ -16,10 +16,8 @@ go_library( ...@@ -16,10 +16,8 @@ go_library(
tags = ["automanaged"], tags = ["automanaged"],
deps = [ deps = [
"//federation/pkg/federation-controller/util:go_default_library", "//federation/pkg/federation-controller/util:go_default_library",
"//pkg/api:go_default_library",
"//pkg/api/unversioned:go_default_library", "//pkg/api/unversioned:go_default_library",
"//pkg/api/v1:go_default_library", "//pkg/api/v1:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/labels:go_default_library", "//pkg/labels:go_default_library",
], ],
) )
......
...@@ -21,10 +21,8 @@ import ( ...@@ -21,10 +21,8 @@ import (
"time" "time"
"k8s.io/kubernetes/federation/pkg/federation-controller/util" "k8s.io/kubernetes/federation/pkg/federation-controller/util"
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned" unversioned "k8s.io/kubernetes/pkg/api/unversioned"
api_v1 "k8s.io/kubernetes/pkg/api/v1" api_v1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
) )
...@@ -47,8 +45,8 @@ const ( ...@@ -47,8 +45,8 @@ const (
// A function that calculates how many pods from the list are in one of // A function that calculates how many pods from the list are in one of
// the meaningful (from the replica set perspective) states. This function is // the meaningful (from the replica set perspective) states. This function is
// a temporary workaround against the current lack of ownerRef in pods. // a temporary workaround against the current lack of ownerRef in pods.
func AnalysePods(selectorv1 *v1beta1.LabelSelector, allPods []util.FederatedObject, currentTime time.Time) (map[string]PodAnalysisResult, error) { func AnalysePods(selectorv1 *unversioned.LabelSelector, allPods []util.FederatedObject, currentTime time.Time) (map[string]PodAnalysisResult, error) {
selector, err := labelSelectorAsSelector(selectorv1) selector, err := unversioned.LabelSelectorAsSelector(selectorv1)
if err != nil { if err != nil {
return nil, fmt.Errorf("invalid selector: %v", err) return nil, fmt.Errorf("invalid selector: %v", err)
} }
...@@ -82,11 +80,3 @@ func AnalysePods(selectorv1 *v1beta1.LabelSelector, allPods []util.FederatedObje ...@@ -82,11 +80,3 @@ func AnalysePods(selectorv1 *v1beta1.LabelSelector, allPods []util.FederatedObje
} }
return result, nil return result, nil
} }
func labelSelectorAsSelector(ps *v1beta1.LabelSelector) (labels.Selector, error) {
unversionedSelector := unversioned.LabelSelector{}
if err := api.Scheme.Convert(ps, &unversionedSelector, nil); err != nil {
return nil, err
}
return unversioned.LabelSelectorAsSelector(&unversionedSelector)
}
...@@ -101,7 +101,7 @@ func newReplicaSet(selectorMap map[string]string) *v1beta1.ReplicaSet { ...@@ -101,7 +101,7 @@ func newReplicaSet(selectorMap map[string]string) *v1beta1.ReplicaSet {
}, },
Spec: v1beta1.ReplicaSetSpec{ Spec: v1beta1.ReplicaSetSpec{
Replicas: &replicas, Replicas: &replicas,
Selector: &v1beta1.LabelSelector{MatchLabels: selectorMap}, Selector: &unversioned.LabelSelector{MatchLabels: selectorMap},
}, },
} }
return rs return rs
......
...@@ -38,7 +38,6 @@ go_library( ...@@ -38,7 +38,6 @@ go_library(
"//pkg/util/intstr:go_default_library", "//pkg/util/intstr:go_default_library",
"//pkg/watch/versioned:go_default_library", "//pkg/watch/versioned:go_default_library",
"//vendor:github.com/gogo/protobuf/proto", "//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/gogo/protobuf/sortkeys",
"//vendor:github.com/ugorji/go/codec", "//vendor:github.com/ugorji/go/codec",
], ],
) )
......
...@@ -20,7 +20,6 @@ import ( ...@@ -20,7 +20,6 @@ import (
"fmt" "fmt"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/batch" "k8s.io/kubernetes/pkg/apis/batch"
"k8s.io/kubernetes/pkg/conversion" "k8s.io/kubernetes/pkg/conversion"
...@@ -53,15 +52,7 @@ func Convert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *JobSpec, s conv ...@@ -53,15 +52,7 @@ func Convert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *JobSpec, s conv
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
// unable to generate simple pointer conversion for unversioned.LabelSelector -> v1.LabelSelector out.Selector = in.Selector
if in.Selector != nil {
out.Selector = new(LabelSelector)
if err := Convert_unversioned_LabelSelector_To_v1_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
if in.ManualSelector != nil { if in.ManualSelector != nil {
out.ManualSelector = new(bool) out.ManualSelector = new(bool)
*out.ManualSelector = *in.ManualSelector *out.ManualSelector = *in.ManualSelector
...@@ -79,15 +70,7 @@ func Convert_v1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conv ...@@ -79,15 +70,7 @@ func Convert_v1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conv
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
// unable to generate simple pointer conversion for v1.LabelSelector -> unversioned.LabelSelector out.Selector = in.Selector
if in.Selector != nil {
out.Selector = new(unversioned.LabelSelector)
if err := Convert_v1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
if in.ManualSelector != nil { if in.ManualSelector != nil {
out.ManualSelector = new(bool) out.ManualSelector = new(bool)
*out.ManualSelector = *in.ManualSelector *out.ManualSelector = *in.ManualSelector
......
...@@ -112,7 +112,7 @@ message JobSpec { ...@@ -112,7 +112,7 @@ message JobSpec {
// Normally, the system sets this field for you. // Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
optional LabelSelector selector = 4; optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector selector = 4;
// ManualSelector controls generation of pod labels and pod selectors. // ManualSelector controls generation of pod labels and pod selectors.
// Leave `manualSelector` unset unless you are certain what you are doing. // Leave `manualSelector` unset unless you are certain what you are doing.
...@@ -165,36 +165,3 @@ message JobStatus { ...@@ -165,36 +165,3 @@ message JobStatus {
optional int32 failed = 6; optional int32 failed = 6;
} }
// A label selector is a label query over a set of resources. The result of matchLabels and
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
message LabelSelector {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
map<string, string> matchLabels = 1;
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
repeated LabelSelectorRequirement matchExpressions = 2;
}
// A label selector requirement is a selector that contains values, a key, and an operator that
// relates the key and values.
message LabelSelectorRequirement {
// key is the label key that the selector applies to.
optional string key = 1;
// operator represents a key's relationship to a set of values.
// Valid operators ard In, NotIn, Exists and DoesNotExist.
optional string operator = 2;
// values is an array of string values. If the operator is In or NotIn,
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
repeated string values = 3;
}
...@@ -83,7 +83,7 @@ type JobSpec struct { ...@@ -83,7 +83,7 @@ type JobSpec struct {
// Normally, the system sets this field for you. // Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"` Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"`
// ManualSelector controls generation of pod labels and pod selectors. // ManualSelector controls generation of pod labels and pod selectors.
// Leave `manualSelector` unset unless you are certain what you are doing. // Leave `manualSelector` unset unless you are certain what you are doing.
...@@ -166,43 +166,3 @@ type JobCondition struct { ...@@ -166,43 +166,3 @@ type JobCondition struct {
// +optional // +optional
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
} }
// A label selector is a label query over a set of resources. The result of matchLabels and
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
type LabelSelector struct {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"`
}
// A label selector requirement is a selector that contains values, a key, and an operator that
// relates the key and values.
type LabelSelectorRequirement struct {
// key is the label key that the selector applies to.
Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"`
// operator represents a key's relationship to a set of values.
// Valid operators ard In, NotIn, Exists and DoesNotExist.
Operator LabelSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=LabelSelectorOperator"`
// values is an array of string values. If the operator is In or NotIn,
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
}
// A label selector operator is the set of operators that can be used in a selector requirement.
type LabelSelectorOperator string
const (
LabelSelectorOpIn LabelSelectorOperator = "In"
LabelSelectorOpNotIn LabelSelectorOperator = "NotIn"
LabelSelectorOpExists LabelSelectorOperator = "Exists"
LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist"
)
...@@ -90,25 +90,4 @@ func (JobStatus) SwaggerDoc() map[string]string { ...@@ -90,25 +90,4 @@ func (JobStatus) SwaggerDoc() map[string]string {
return map_JobStatus return map_JobStatus
} }
var map_LabelSelector = map[string]string{
"": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
"matchLabels": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
"matchExpressions": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
}
func (LabelSelector) SwaggerDoc() map[string]string {
return map_LabelSelector
}
var map_LabelSelectorRequirement = map[string]string{
"": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
"key": "key is the label key that the selector applies to.",
"operator": "operator represents a key's relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist.",
"values": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.",
}
func (LabelSelectorRequirement) SwaggerDoc() map[string]string {
return map_LabelSelectorRequirement
}
// AUTO-GENERATED FUNCTIONS END HERE // AUTO-GENERATED FUNCTIONS END HERE
...@@ -22,7 +22,6 @@ package v1 ...@@ -22,7 +22,6 @@ package v1
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
api_v1 "k8s.io/kubernetes/pkg/api/v1" api_v1 "k8s.io/kubernetes/pkg/api/v1"
batch "k8s.io/kubernetes/pkg/apis/batch" batch "k8s.io/kubernetes/pkg/apis/batch"
conversion "k8s.io/kubernetes/pkg/conversion" conversion "k8s.io/kubernetes/pkg/conversion"
...@@ -47,10 +46,6 @@ func RegisterConversions(scheme *runtime.Scheme) error { ...@@ -47,10 +46,6 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_batch_JobSpec_To_v1_JobSpec, Convert_batch_JobSpec_To_v1_JobSpec,
Convert_v1_JobStatus_To_batch_JobStatus, Convert_v1_JobStatus_To_batch_JobStatus,
Convert_batch_JobStatus_To_v1_JobStatus, Convert_batch_JobStatus_To_v1_JobStatus,
Convert_v1_LabelSelector_To_unversioned_LabelSelector,
Convert_unversioned_LabelSelector_To_v1_LabelSelector,
Convert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement,
Convert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement,
) )
} }
...@@ -186,15 +181,7 @@ func autoConvert_v1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s ...@@ -186,15 +181,7 @@ func autoConvert_v1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
if in.Selector != nil { out.Selector = in.Selector
in, out := &in.Selector, &out.Selector
*out = new(unversioned.LabelSelector)
if err := Convert_v1_LabelSelector_To_unversioned_LabelSelector(*in, *out, s); err != nil {
return err
}
} else {
out.Selector = nil
}
out.ManualSelector = in.ManualSelector out.ManualSelector = in.ManualSelector
if err := api_v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := api_v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
...@@ -206,15 +193,7 @@ func autoConvert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *JobSpec, s ...@@ -206,15 +193,7 @@ func autoConvert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *JobSpec, s
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
if in.Selector != nil { out.Selector = in.Selector
in, out := &in.Selector, &out.Selector
*out = new(LabelSelector)
if err := Convert_unversioned_LabelSelector_To_v1_LabelSelector(*in, *out, s); err != nil {
return err
}
} else {
out.Selector = nil
}
out.ManualSelector = in.ManualSelector out.ManualSelector = in.ManualSelector
if err := api_v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := api_v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
...@@ -269,65 +248,3 @@ func autoConvert_batch_JobStatus_To_v1_JobStatus(in *batch.JobStatus, out *JobSt ...@@ -269,65 +248,3 @@ func autoConvert_batch_JobStatus_To_v1_JobStatus(in *batch.JobStatus, out *JobSt
func Convert_batch_JobStatus_To_v1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { func Convert_batch_JobStatus_To_v1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error {
return autoConvert_batch_JobStatus_To_v1_JobStatus(in, out, s) return autoConvert_batch_JobStatus_To_v1_JobStatus(in, out, s)
} }
func autoConvert_v1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error {
out.MatchLabels = in.MatchLabels
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]unversioned.LabelSelectorRequirement, len(*in))
for i := range *in {
if err := Convert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
func Convert_v1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error {
return autoConvert_v1_LabelSelector_To_unversioned_LabelSelector(in, out, s)
}
func autoConvert_unversioned_LabelSelector_To_v1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error {
out.MatchLabels = in.MatchLabels
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]LabelSelectorRequirement, len(*in))
for i := range *in {
if err := Convert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
func Convert_unversioned_LabelSelector_To_v1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error {
return autoConvert_unversioned_LabelSelector_To_v1_LabelSelector(in, out, s)
}
func autoConvert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error {
out.Key = in.Key
out.Operator = unversioned.LabelSelectorOperator(in.Operator)
out.Values = in.Values
return nil
}
func Convert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error {
return autoConvert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in, out, s)
}
func autoConvert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error {
out.Key = in.Key
out.Operator = LabelSelectorOperator(in.Operator)
out.Values = in.Values
return nil
}
func Convert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error {
return autoConvert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(in, out, s)
}
...@@ -41,8 +41,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -41,8 +41,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobList, InType: reflect.TypeOf(&JobList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobList, InType: reflect.TypeOf(&JobList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobSpec, InType: reflect.TypeOf(&JobSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobSpec, InType: reflect.TypeOf(&JobSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobStatus, InType: reflect.TypeOf(&JobStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobStatus, InType: reflect.TypeOf(&JobStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LabelSelector, InType: reflect.TypeOf(&LabelSelector{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LabelSelectorRequirement, InType: reflect.TypeOf(&LabelSelectorRequirement{})},
) )
} }
...@@ -126,8 +124,8 @@ func DeepCopy_v1_JobSpec(in interface{}, out interface{}, c *conversion.Cloner) ...@@ -126,8 +124,8 @@ func DeepCopy_v1_JobSpec(in interface{}, out interface{}, c *conversion.Cloner)
} }
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
*out = new(LabelSelector) *out = new(unversioned.LabelSelector)
if err := DeepCopy_v1_LabelSelector(*in, *out, c); err != nil { if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err return err
} }
} else { } else {
...@@ -182,48 +180,3 @@ func DeepCopy_v1_JobStatus(in interface{}, out interface{}, c *conversion.Cloner ...@@ -182,48 +180,3 @@ func DeepCopy_v1_JobStatus(in interface{}, out interface{}, c *conversion.Cloner
return nil return nil
} }
} }
func DeepCopy_v1_LabelSelector(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelector)
out := out.(*LabelSelector)
if in.MatchLabels != nil {
in, out := &in.MatchLabels, &out.MatchLabels
*out = make(map[string]string)
for key, val := range *in {
(*out)[key] = val
}
} else {
out.MatchLabels = nil
}
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]LabelSelectorRequirement, len(*in))
for i := range *in {
if err := DeepCopy_v1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
}
func DeepCopy_v1_LabelSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelectorRequirement)
out := out.(*LabelSelectorRequirement)
out.Key = in.Key
out.Operator = in.Operator
if in.Values != nil {
in, out := &in.Values, &out.Values
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Values = nil
}
return nil
}
}
...@@ -38,7 +38,6 @@ go_library( ...@@ -38,7 +38,6 @@ go_library(
"//pkg/util/intstr:go_default_library", "//pkg/util/intstr:go_default_library",
"//pkg/watch/versioned:go_default_library", "//pkg/watch/versioned:go_default_library",
"//vendor:github.com/gogo/protobuf/proto", "//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/gogo/protobuf/sortkeys",
"//vendor:github.com/ugorji/go/codec", "//vendor:github.com/ugorji/go/codec",
], ],
) )
......
...@@ -20,7 +20,6 @@ import ( ...@@ -20,7 +20,6 @@ import (
"fmt" "fmt"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/batch" "k8s.io/kubernetes/pkg/apis/batch"
"k8s.io/kubernetes/pkg/conversion" "k8s.io/kubernetes/pkg/conversion"
...@@ -59,15 +58,7 @@ func Convert_batch_JobSpec_To_v2alpha1_JobSpec(in *batch.JobSpec, out *JobSpec, ...@@ -59,15 +58,7 @@ func Convert_batch_JobSpec_To_v2alpha1_JobSpec(in *batch.JobSpec, out *JobSpec,
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
// unable to generate simple pointer conversion for unversioned.LabelSelector -> v1.LabelSelector out.Selector = in.Selector
if in.Selector != nil {
out.Selector = new(LabelSelector)
if err := Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
if in.ManualSelector != nil { if in.ManualSelector != nil {
out.ManualSelector = new(bool) out.ManualSelector = new(bool)
*out.ManualSelector = *in.ManualSelector *out.ManualSelector = *in.ManualSelector
...@@ -85,15 +76,7 @@ func Convert_v2alpha1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, ...@@ -85,15 +76,7 @@ func Convert_v2alpha1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec,
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
// unable to generate simple pointer conversion for unversioned.LabelSelector -> v1.LabelSelector out.Selector = in.Selector
if in.Selector != nil {
out.Selector = new(unversioned.LabelSelector)
if err := Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
if in.ManualSelector != nil { if in.ManualSelector != nil {
out.ManualSelector = new(bool) out.ManualSelector = new(bool)
*out.ManualSelector = *in.ManualSelector *out.ManualSelector = *in.ManualSelector
......
...@@ -112,7 +112,7 @@ message JobSpec { ...@@ -112,7 +112,7 @@ message JobSpec {
// Normally, the system sets this field for you. // Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
optional LabelSelector selector = 4; optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector selector = 4;
// ManualSelector controls generation of pod labels and pod selectors. // ManualSelector controls generation of pod labels and pod selectors.
// Leave `manualSelector` unset unless you are certain what you are doing. // Leave `manualSelector` unset unless you are certain what you are doing.
...@@ -191,39 +191,6 @@ message JobTemplateSpec { ...@@ -191,39 +191,6 @@ message JobTemplateSpec {
optional JobSpec spec = 2; optional JobSpec spec = 2;
} }
// A label selector is a label query over a set of resources. The result of matchLabels and
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
message LabelSelector {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
map<string, string> matchLabels = 1;
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
repeated LabelSelectorRequirement matchExpressions = 2;
}
// A label selector requirement is a selector that contains values, a key, and an operator that
// relates the key and values.
message LabelSelectorRequirement {
// key is the label key that the selector applies to.
optional string key = 1;
// operator represents a key's relationship to a set of values.
// Valid operators ard In, NotIn, Exists and DoesNotExist.
optional string operator = 2;
// values is an array of string values. If the operator is In or NotIn,
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
repeated string values = 3;
}
// ScheduledJob represents the configuration of a single scheduled job. // ScheduledJob represents the configuration of a single scheduled job.
message ScheduledJob { message ScheduledJob {
// Standard object's metadata. // Standard object's metadata.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -108,7 +108,7 @@ type JobSpec struct { ...@@ -108,7 +108,7 @@ type JobSpec struct {
// Normally, the system sets this field for you. // Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"` Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"`
// ManualSelector controls generation of pod labels and pod selectors. // ManualSelector controls generation of pod labels and pod selectors.
// Leave `manualSelector` unset unless you are certain what you are doing. // Leave `manualSelector` unset unless you are certain what you are doing.
...@@ -276,43 +276,3 @@ type ScheduledJobStatus struct { ...@@ -276,43 +276,3 @@ type ScheduledJobStatus struct {
// +optional // +optional
LastScheduleTime *unversioned.Time `json:"lastScheduleTime,omitempty" protobuf:"bytes,4,opt,name=lastScheduleTime"` LastScheduleTime *unversioned.Time `json:"lastScheduleTime,omitempty" protobuf:"bytes,4,opt,name=lastScheduleTime"`
} }
// A label selector is a label query over a set of resources. The result of matchLabels and
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
type LabelSelector struct {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"`
}
// A label selector requirement is a selector that contains values, a key, and an operator that
// relates the key and values.
type LabelSelectorRequirement struct {
// key is the label key that the selector applies to.
Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"`
// operator represents a key's relationship to a set of values.
// Valid operators ard In, NotIn, Exists and DoesNotExist.
Operator LabelSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=LabelSelectorOperator"`
// values is an array of string values. If the operator is In or NotIn,
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
}
// A label selector operator is the set of operators that can be used in a selector requirement.
type LabelSelectorOperator string
const (
LabelSelectorOpIn LabelSelectorOperator = "In"
LabelSelectorOpNotIn LabelSelectorOperator = "NotIn"
LabelSelectorOpExists LabelSelectorOperator = "Exists"
LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist"
)
...@@ -110,27 +110,6 @@ func (JobTemplateSpec) SwaggerDoc() map[string]string { ...@@ -110,27 +110,6 @@ func (JobTemplateSpec) SwaggerDoc() map[string]string {
return map_JobTemplateSpec return map_JobTemplateSpec
} }
var map_LabelSelector = map[string]string{
"": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
"matchLabels": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
"matchExpressions": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
}
func (LabelSelector) SwaggerDoc() map[string]string {
return map_LabelSelector
}
var map_LabelSelectorRequirement = map[string]string{
"": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
"key": "key is the label key that the selector applies to.",
"operator": "operator represents a key's relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist.",
"values": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.",
}
func (LabelSelectorRequirement) SwaggerDoc() map[string]string {
return map_LabelSelectorRequirement
}
var map_ScheduledJob = map[string]string{ var map_ScheduledJob = map[string]string{
"": "ScheduledJob represents the configuration of a single scheduled job.", "": "ScheduledJob represents the configuration of a single scheduled job.",
"metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
......
...@@ -22,7 +22,6 @@ package v2alpha1 ...@@ -22,7 +22,6 @@ package v2alpha1
import ( import (
api "k8s.io/kubernetes/pkg/api" api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
batch "k8s.io/kubernetes/pkg/apis/batch" batch "k8s.io/kubernetes/pkg/apis/batch"
conversion "k8s.io/kubernetes/pkg/conversion" conversion "k8s.io/kubernetes/pkg/conversion"
...@@ -51,10 +50,6 @@ func RegisterConversions(scheme *runtime.Scheme) error { ...@@ -51,10 +50,6 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_batch_JobTemplate_To_v2alpha1_JobTemplate, Convert_batch_JobTemplate_To_v2alpha1_JobTemplate,
Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec, Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec,
Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec, Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec,
Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector,
Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector,
Convert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement,
Convert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement,
Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob, Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob,
Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob, Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob,
Convert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList, Convert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList,
...@@ -198,15 +193,7 @@ func autoConvert_v2alpha1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSp ...@@ -198,15 +193,7 @@ func autoConvert_v2alpha1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSp
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
if in.Selector != nil { out.Selector = in.Selector
in, out := &in.Selector, &out.Selector
*out = new(unversioned.LabelSelector)
if err := Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(*in, *out, s); err != nil {
return err
}
} else {
out.Selector = nil
}
out.ManualSelector = in.ManualSelector out.ManualSelector = in.ManualSelector
if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
...@@ -218,15 +205,7 @@ func autoConvert_batch_JobSpec_To_v2alpha1_JobSpec(in *batch.JobSpec, out *JobSp ...@@ -218,15 +205,7 @@ func autoConvert_batch_JobSpec_To_v2alpha1_JobSpec(in *batch.JobSpec, out *JobSp
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
if in.Selector != nil { out.Selector = in.Selector
in, out := &in.Selector, &out.Selector
*out = new(LabelSelector)
if err := Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(*in, *out, s); err != nil {
return err
}
} else {
out.Selector = nil
}
out.ManualSelector = in.ManualSelector out.ManualSelector = in.ManualSelector
if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
...@@ -348,68 +327,6 @@ func Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in *batch.JobTemp ...@@ -348,68 +327,6 @@ func Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in *batch.JobTemp
return autoConvert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in, out, s) return autoConvert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in, out, s)
} }
func autoConvert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error {
out.MatchLabels = in.MatchLabels
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]unversioned.LabelSelectorRequirement, len(*in))
for i := range *in {
if err := Convert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
func Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error {
return autoConvert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in, out, s)
}
func autoConvert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error {
out.MatchLabels = in.MatchLabels
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]LabelSelectorRequirement, len(*in))
for i := range *in {
if err := Convert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
func Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error {
return autoConvert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in, out, s)
}
func autoConvert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error {
out.Key = in.Key
out.Operator = unversioned.LabelSelectorOperator(in.Operator)
out.Values = in.Values
return nil
}
func Convert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error {
return autoConvert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in, out, s)
}
func autoConvert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error {
out.Key = in.Key
out.Operator = LabelSelectorOperator(in.Operator)
out.Values = in.Values
return nil
}
func Convert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error {
return autoConvert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(in, out, s)
}
func autoConvert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in *ScheduledJob, out *batch.ScheduledJob, s conversion.Scope) error { func autoConvert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in *ScheduledJob, out *batch.ScheduledJob, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err return err
......
...@@ -43,8 +43,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -43,8 +43,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobStatus, InType: reflect.TypeOf(&JobStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobStatus, InType: reflect.TypeOf(&JobStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobTemplate, InType: reflect.TypeOf(&JobTemplate{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobTemplate, InType: reflect.TypeOf(&JobTemplate{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobTemplateSpec, InType: reflect.TypeOf(&JobTemplateSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobTemplateSpec, InType: reflect.TypeOf(&JobTemplateSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_LabelSelector, InType: reflect.TypeOf(&LabelSelector{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_LabelSelectorRequirement, InType: reflect.TypeOf(&LabelSelectorRequirement{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJob, InType: reflect.TypeOf(&ScheduledJob{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJob, InType: reflect.TypeOf(&ScheduledJob{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJobList, InType: reflect.TypeOf(&ScheduledJobList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJobList, InType: reflect.TypeOf(&ScheduledJobList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJobSpec, InType: reflect.TypeOf(&ScheduledJobSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJobSpec, InType: reflect.TypeOf(&ScheduledJobSpec{})},
...@@ -132,8 +130,8 @@ func DeepCopy_v2alpha1_JobSpec(in interface{}, out interface{}, c *conversion.Cl ...@@ -132,8 +130,8 @@ func DeepCopy_v2alpha1_JobSpec(in interface{}, out interface{}, c *conversion.Cl
} }
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
*out = new(LabelSelector) *out = new(unversioned.LabelSelector)
if err := DeepCopy_v2alpha1_LabelSelector(*in, *out, c); err != nil { if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err return err
} }
} else { } else {
...@@ -218,51 +216,6 @@ func DeepCopy_v2alpha1_JobTemplateSpec(in interface{}, out interface{}, c *conve ...@@ -218,51 +216,6 @@ func DeepCopy_v2alpha1_JobTemplateSpec(in interface{}, out interface{}, c *conve
} }
} }
func DeepCopy_v2alpha1_LabelSelector(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelector)
out := out.(*LabelSelector)
if in.MatchLabels != nil {
in, out := &in.MatchLabels, &out.MatchLabels
*out = make(map[string]string)
for key, val := range *in {
(*out)[key] = val
}
} else {
out.MatchLabels = nil
}
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]LabelSelectorRequirement, len(*in))
for i := range *in {
if err := DeepCopy_v2alpha1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
}
func DeepCopy_v2alpha1_LabelSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelectorRequirement)
out := out.(*LabelSelectorRequirement)
out.Key = in.Key
out.Operator = in.Operator
if in.Values != nil {
in, out := &in.Values, &out.Values
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Values = nil
}
return nil
}
}
func DeepCopy_v2alpha1_ScheduledJob(in interface{}, out interface{}, c *conversion.Cloner) error { func DeepCopy_v2alpha1_ScheduledJob(in interface{}, out interface{}, c *conversion.Cloner) error {
{ {
in := in.(*ScheduledJob) in := in.(*ScheduledJob)
......
...@@ -56,6 +56,7 @@ go_test( ...@@ -56,6 +56,7 @@ go_test(
"//pkg/api:go_default_library", "//pkg/api:go_default_library",
"//pkg/api/install:go_default_library", "//pkg/api/install:go_default_library",
"//pkg/api/resource:go_default_library", "//pkg/api/resource:go_default_library",
"//pkg/api/unversioned:go_default_library",
"//pkg/api/v1:go_default_library", "//pkg/api/v1:go_default_library",
"//pkg/apis/batch:go_default_library", "//pkg/apis/batch:go_default_library",
"//pkg/apis/extensions/install:go_default_library", "//pkg/apis/extensions/install:go_default_library",
......
...@@ -134,14 +134,7 @@ func Convert_v1beta1_ScaleStatus_To_extensions_ScaleStatus(in *ScaleStatus, out ...@@ -134,14 +134,7 @@ func Convert_v1beta1_ScaleStatus_To_extensions_ScaleStatus(in *ScaleStatus, out
func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions.DeploymentSpec, out *DeploymentSpec, s conversion.Scope) error { func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions.DeploymentSpec, out *DeploymentSpec, s conversion.Scope) error {
out.Replicas = &in.Replicas out.Replicas = &in.Replicas
if in.Selector != nil { out.Selector = in.Selector
out.Selector = new(LabelSelector)
if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
} }
...@@ -167,15 +160,7 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *DeploymentS ...@@ -167,15 +160,7 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *DeploymentS
if in.Replicas != nil { if in.Replicas != nil {
out.Replicas = *in.Replicas out.Replicas = *in.Replicas
} }
out.Selector = in.Selector
if in.Selector != nil {
out.Selector = new(unversioned.LabelSelector)
if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
} }
...@@ -250,15 +235,7 @@ func Convert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *extensions. ...@@ -250,15 +235,7 @@ func Convert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *extensions.
out.Replicas = new(int32) out.Replicas = new(int32)
*out.Replicas = int32(in.Replicas) *out.Replicas = int32(in.Replicas)
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = in.MinReadySeconds
if in.Selector != nil { out.Selector = in.Selector
out.Selector = new(LabelSelector)
if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
} }
...@@ -270,14 +247,7 @@ func Convert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(in *ReplicaSetS ...@@ -270,14 +247,7 @@ func Convert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(in *ReplicaSetS
out.Replicas = *in.Replicas out.Replicas = *in.Replicas
} }
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = in.MinReadySeconds
if in.Selector != nil { out.Selector = in.Selector
out.Selector = new(unversioned.LabelSelector)
if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
} }
...@@ -288,16 +258,7 @@ func Convert_batch_JobSpec_To_v1beta1_JobSpec(in *batch.JobSpec, out *JobSpec, s ...@@ -288,16 +258,7 @@ func Convert_batch_JobSpec_To_v1beta1_JobSpec(in *batch.JobSpec, out *JobSpec, s
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
// unable to generate simple pointer conversion for unversioned.LabelSelector -> v1beta1.LabelSelector out.Selector = in.Selector
if in.Selector != nil {
out.Selector = new(LabelSelector)
if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
// BEGIN non-standard conversion // BEGIN non-standard conversion
// autoSelector has opposite meaning as manualSelector. // autoSelector has opposite meaning as manualSelector.
// in both cases, unset means false, and unset is always preferred to false. // in both cases, unset means false, and unset is always preferred to false.
...@@ -322,16 +283,7 @@ func Convert_v1beta1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s ...@@ -322,16 +283,7 @@ func Convert_v1beta1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s
out.Parallelism = in.Parallelism out.Parallelism = in.Parallelism
out.Completions = in.Completions out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
// unable to generate simple pointer conversion for v1beta1.LabelSelector -> unversioned.LabelSelector out.Selector = in.Selector
if in.Selector != nil {
out.Selector = new(unversioned.LabelSelector)
if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in.Selector, out.Selector, s); err != nil {
return err
}
} else {
out.Selector = nil
}
// BEGIN non-standard conversion // BEGIN non-standard conversion
// autoSelector has opposite meaning as manualSelector. // autoSelector has opposite meaning as manualSelector.
// in both cases, unset means false, and unset is always preferred to false. // in both cases, unset means false, and unset is always preferred to false.
......
...@@ -17,6 +17,7 @@ limitations under the License. ...@@ -17,6 +17,7 @@ limitations under the License.
package v1beta1 package v1beta1
import ( import (
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/pkg/util/intstr"
...@@ -40,7 +41,7 @@ func SetDefaults_DaemonSet(obj *DaemonSet) { ...@@ -40,7 +41,7 @@ func SetDefaults_DaemonSet(obj *DaemonSet) {
// TODO: support templates defined elsewhere when we support them in the API // TODO: support templates defined elsewhere when we support them in the API
if labels != nil { if labels != nil {
if obj.Spec.Selector == nil { if obj.Spec.Selector == nil {
obj.Spec.Selector = &LabelSelector{ obj.Spec.Selector = &unversioned.LabelSelector{
MatchLabels: labels, MatchLabels: labels,
} }
} }
...@@ -56,7 +57,7 @@ func SetDefaults_Deployment(obj *Deployment) { ...@@ -56,7 +57,7 @@ func SetDefaults_Deployment(obj *Deployment) {
if labels != nil { if labels != nil {
if obj.Spec.Selector == nil { if obj.Spec.Selector == nil {
obj.Spec.Selector = &LabelSelector{MatchLabels: labels} obj.Spec.Selector = &unversioned.LabelSelector{MatchLabels: labels}
} }
if len(obj.Labels) == 0 { if len(obj.Labels) == 0 {
obj.Labels = labels obj.Labels = labels
...@@ -102,7 +103,7 @@ func SetDefaults_Job(obj *Job) { ...@@ -102,7 +103,7 @@ func SetDefaults_Job(obj *Job) {
// and default behavior for an unspecified manual selector is to use the pod template labels // and default behavior for an unspecified manual selector is to use the pod template labels
if manualSelector && obj.Spec.Selector == nil { if manualSelector && obj.Spec.Selector == nil {
obj.Spec.Selector = &LabelSelector{ obj.Spec.Selector = &unversioned.LabelSelector{
MatchLabels: labels, MatchLabels: labels,
} }
} }
...@@ -140,7 +141,7 @@ func SetDefaults_ReplicaSet(obj *ReplicaSet) { ...@@ -140,7 +141,7 @@ func SetDefaults_ReplicaSet(obj *ReplicaSet) {
// TODO: support templates defined elsewhere when we support them in the API // TODO: support templates defined elsewhere when we support them in the API
if labels != nil { if labels != nil {
if obj.Spec.Selector == nil { if obj.Spec.Selector == nil {
obj.Spec.Selector = &LabelSelector{ obj.Spec.Selector = &unversioned.LabelSelector{
MatchLabels: labels, MatchLabels: labels,
} }
} }
......
...@@ -23,6 +23,7 @@ import ( ...@@ -23,6 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
_ "k8s.io/kubernetes/pkg/api/install" _ "k8s.io/kubernetes/pkg/api/install"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
_ "k8s.io/kubernetes/pkg/apis/extensions/install" _ "k8s.io/kubernetes/pkg/apis/extensions/install"
. "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" . "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
...@@ -67,7 +68,7 @@ func TestSetDefaultDaemonSet(t *testing.T) { ...@@ -67,7 +68,7 @@ func TestSetDefaultDaemonSet(t *testing.T) {
Labels: defaultLabels, Labels: defaultLabels,
}, },
Spec: DaemonSetSpec{ Spec: DaemonSetSpec{
Selector: &LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: defaultLabels, MatchLabels: defaultLabels,
}, },
Template: defaultTemplate, Template: defaultTemplate,
...@@ -92,7 +93,7 @@ func TestSetDefaultDaemonSet(t *testing.T) { ...@@ -92,7 +93,7 @@ func TestSetDefaultDaemonSet(t *testing.T) {
}, },
}, },
Spec: DaemonSetSpec{ Spec: DaemonSetSpec{
Selector: &LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: defaultLabels, MatchLabels: defaultLabels,
}, },
Template: defaultTemplate, Template: defaultTemplate,
...@@ -449,18 +450,18 @@ func TestSetDefaultJob(t *testing.T) { ...@@ -449,18 +450,18 @@ func TestSetDefaultJob(t *testing.T) {
func TestSetDefaultJobSelector(t *testing.T) { func TestSetDefaultJobSelector(t *testing.T) {
tests := []struct { tests := []struct {
original *Job original *Job
expectedSelector *LabelSelector expectedSelector *unversioned.LabelSelector
}{ }{
// selector set explicitly, nil autoSelector // selector set explicitly, nil autoSelector
{ {
original: &Job{ original: &Job{
Spec: JobSpec{ Spec: JobSpec{
Selector: &LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: map[string]string{"job": "selector"}, MatchLabels: map[string]string{"job": "selector"},
}, },
}, },
}, },
expectedSelector: &LabelSelector{ expectedSelector: &unversioned.LabelSelector{
MatchLabels: map[string]string{"job": "selector"}, MatchLabels: map[string]string{"job": "selector"},
}, },
}, },
...@@ -468,13 +469,13 @@ func TestSetDefaultJobSelector(t *testing.T) { ...@@ -468,13 +469,13 @@ func TestSetDefaultJobSelector(t *testing.T) {
{ {
original: &Job{ original: &Job{
Spec: JobSpec{ Spec: JobSpec{
Selector: &LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: map[string]string{"job": "selector"}, MatchLabels: map[string]string{"job": "selector"},
}, },
AutoSelector: newBool(true), AutoSelector: newBool(true),
}, },
}, },
expectedSelector: &LabelSelector{ expectedSelector: &unversioned.LabelSelector{
MatchLabels: map[string]string{"job": "selector"}, MatchLabels: map[string]string{"job": "selector"},
}, },
}, },
...@@ -482,13 +483,13 @@ func TestSetDefaultJobSelector(t *testing.T) { ...@@ -482,13 +483,13 @@ func TestSetDefaultJobSelector(t *testing.T) {
{ {
original: &Job{ original: &Job{
Spec: JobSpec{ Spec: JobSpec{
Selector: &LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: map[string]string{"job": "selector"}, MatchLabels: map[string]string{"job": "selector"},
}, },
AutoSelector: newBool(false), AutoSelector: newBool(false),
}, },
}, },
expectedSelector: &LabelSelector{ expectedSelector: &unversioned.LabelSelector{
MatchLabels: map[string]string{"job": "selector"}, MatchLabels: map[string]string{"job": "selector"},
}, },
}, },
...@@ -503,7 +504,7 @@ func TestSetDefaultJobSelector(t *testing.T) { ...@@ -503,7 +504,7 @@ func TestSetDefaultJobSelector(t *testing.T) {
}, },
}, },
}, },
expectedSelector: &LabelSelector{ expectedSelector: &unversioned.LabelSelector{
MatchLabels: map[string]string{"job": "selector"}, MatchLabels: map[string]string{"job": "selector"},
}, },
}, },
...@@ -519,7 +520,7 @@ func TestSetDefaultJobSelector(t *testing.T) { ...@@ -519,7 +520,7 @@ func TestSetDefaultJobSelector(t *testing.T) {
AutoSelector: newBool(false), AutoSelector: newBool(false),
}, },
}, },
expectedSelector: &LabelSelector{ expectedSelector: &unversioned.LabelSelector{
MatchLabels: map[string]string{"job": "selector"}, MatchLabels: map[string]string{"job": "selector"},
}, },
}, },
...@@ -601,7 +602,7 @@ func TestSetDefaultReplicaSet(t *testing.T) { ...@@ -601,7 +602,7 @@ func TestSetDefaultReplicaSet(t *testing.T) {
}, },
}, },
Spec: ReplicaSetSpec{ Spec: ReplicaSetSpec{
Selector: &LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: map[string]string{ MatchLabels: map[string]string{
"some": "other", "some": "other",
}, },
...@@ -621,7 +622,7 @@ func TestSetDefaultReplicaSet(t *testing.T) { ...@@ -621,7 +622,7 @@ func TestSetDefaultReplicaSet(t *testing.T) {
{ {
rs: &ReplicaSet{ rs: &ReplicaSet{
Spec: ReplicaSetSpec{ Spec: ReplicaSetSpec{
Selector: &LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: map[string]string{ MatchLabels: map[string]string{
"some": "other", "some": "other",
}, },
......
...@@ -107,7 +107,7 @@ message DaemonSetSpec { ...@@ -107,7 +107,7 @@ message DaemonSetSpec {
// If empty, defaulted to labels on Pod template. // If empty, defaulted to labels on Pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
optional LabelSelector selector = 1; optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector selector = 1;
// Template is the object that describes the pod that will be created. // Template is the object that describes the pod that will be created.
// The DaemonSet will create exactly one copy of this pod on every node // The DaemonSet will create exactly one copy of this pod on every node
...@@ -187,7 +187,7 @@ message DeploymentSpec { ...@@ -187,7 +187,7 @@ message DeploymentSpec {
// Label selector for pods. Existing ReplicaSets whose pods are // Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment. // selected by this will be the ones affected by this deployment.
// +optional // +optional
optional LabelSelector selector = 2; optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector selector = 2;
// Template describes the pods that will be created. // Template describes the pods that will be created.
optional k8s.io.kubernetes.pkg.api.v1.PodTemplateSpec template = 3; optional k8s.io.kubernetes.pkg.api.v1.PodTemplateSpec template = 3;
...@@ -598,7 +598,7 @@ message JobSpec { ...@@ -598,7 +598,7 @@ message JobSpec {
// Normally, the system sets this field for you. // Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
optional LabelSelector selector = 4; optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector selector = 4;
// AutoSelector controls generation of pod labels and pod selectors. // AutoSelector controls generation of pod labels and pod selectors.
// It was not present in the original extensions/v1beta1 Job definition, but exists // It was not present in the original extensions/v1beta1 Job definition, but exists
...@@ -646,39 +646,6 @@ message JobStatus { ...@@ -646,39 +646,6 @@ message JobStatus {
optional int32 failed = 6; optional int32 failed = 6;
} }
// A label selector is a label query over a set of resources. The result of matchLabels and
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
message LabelSelector {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
map<string, string> matchLabels = 1;
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
repeated LabelSelectorRequirement matchExpressions = 2;
}
// A label selector requirement is a selector that contains values, a key, and an operator that
// relates the key and values.
message LabelSelectorRequirement {
// key is the label key that the selector applies to.
optional string key = 1;
// operator represents a key's relationship to a set of values.
// Valid operators ard In, NotIn, Exists and DoesNotExist.
optional string operator = 2;
// values is an array of string values. If the operator is In or NotIn,
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
repeated string values = 3;
}
message NetworkPolicy { message NetworkPolicy {
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
...@@ -730,7 +697,7 @@ message NetworkPolicyPeer { ...@@ -730,7 +697,7 @@ message NetworkPolicyPeer {
// If not provided, this selector selects no pods. // If not provided, this selector selects no pods.
// If present but empty, this selector selects all pods in this namespace. // If present but empty, this selector selects all pods in this namespace.
// +optional // +optional
optional LabelSelector podSelector = 1; optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector podSelector = 1;
// Selects Namespaces using cluster scoped-labels. This // Selects Namespaces using cluster scoped-labels. This
// matches all pods in all namespaces selected by this label selector. // matches all pods in all namespaces selected by this label selector.
...@@ -738,7 +705,7 @@ message NetworkPolicyPeer { ...@@ -738,7 +705,7 @@ message NetworkPolicyPeer {
// If omitted, this selector selects no namespaces. // If omitted, this selector selects no namespaces.
// If present but empty, this selector selects all namespaces. // If present but empty, this selector selects all namespaces.
// +optional // +optional
optional LabelSelector namespaceSelector = 2; optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector namespaceSelector = 2;
} }
message NetworkPolicyPort { message NetworkPolicyPort {
...@@ -762,7 +729,7 @@ message NetworkPolicySpec { ...@@ -762,7 +729,7 @@ message NetworkPolicySpec {
// same set of pods. In this case, the ingress rules for each are combined additively. // same set of pods. In this case, the ingress rules for each are combined additively.
// This field is NOT optional and follows standard label selector semantics. // This field is NOT optional and follows standard label selector semantics.
// An empty podSelector matches all pods in this namespace. // An empty podSelector matches all pods in this namespace.
optional LabelSelector podSelector = 1; optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector podSelector = 1;
// List of ingress rules to be applied to the selected pods. // List of ingress rules to be applied to the selected pods.
// Traffic is allowed to a pod if namespace.networkPolicy.ingress.isolation is undefined and cluster policy allows it, // Traffic is allowed to a pod if namespace.networkPolicy.ingress.isolation is undefined and cluster policy allows it,
...@@ -940,7 +907,7 @@ message ReplicaSetSpec { ...@@ -940,7 +907,7 @@ message ReplicaSetSpec {
// Label keys and values that must match in order to be controlled by this replica set. // Label keys and values that must match in order to be controlled by this replica set.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
optional LabelSelector selector = 2; optional k8s.io.kubernetes.pkg.api.unversioned.LabelSelector selector = 2;
// Template is the object that describes the pod that will be created if // Template is the object that describes the pod that will be created if
// insufficient replicas are detected. // insufficient replicas are detected.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -264,7 +264,7 @@ type DeploymentSpec struct { ...@@ -264,7 +264,7 @@ type DeploymentSpec struct {
// Label selector for pods. Existing ReplicaSets whose pods are // Label selector for pods. Existing ReplicaSets whose pods are
// selected by this will be the ones affected by this deployment. // selected by this will be the ones affected by this deployment.
// +optional // +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"` Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
// Template describes the pods that will be created. // Template describes the pods that will be created.
Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"` Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"`
...@@ -464,7 +464,7 @@ type DaemonSetSpec struct { ...@@ -464,7 +464,7 @@ type DaemonSetSpec struct {
// If empty, defaulted to labels on Pod template. // If empty, defaulted to labels on Pod template.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"` Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
// Template is the object that describes the pod that will be created. // Template is the object that describes the pod that will be created.
// The DaemonSet will create exactly one copy of this pod on every node // The DaemonSet will create exactly one copy of this pod on every node
...@@ -630,7 +630,7 @@ type JobSpec struct { ...@@ -630,7 +630,7 @@ type JobSpec struct {
// Normally, the system sets this field for you. // Normally, the system sets this field for you.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"` Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"`
// AutoSelector controls generation of pod labels and pod selectors. // AutoSelector controls generation of pod labels and pod selectors.
// It was not present in the original extensions/v1beta1 Job definition, but exists // It was not present in the original extensions/v1beta1 Job definition, but exists
...@@ -884,46 +884,6 @@ type ExportOptions struct { ...@@ -884,46 +884,6 @@ type ExportOptions struct {
Exact bool `json:"exact" protobuf:"varint,2,opt,name=exact"` Exact bool `json:"exact" protobuf:"varint,2,opt,name=exact"`
} }
// A label selector is a label query over a set of resources. The result of matchLabels and
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
type LabelSelector struct {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
MatchLabels map[string]string `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"`
}
// A label selector requirement is a selector that contains values, a key, and an operator that
// relates the key and values.
type LabelSelectorRequirement struct {
// key is the label key that the selector applies to.
Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"`
// operator represents a key's relationship to a set of values.
// Valid operators ard In, NotIn, Exists and DoesNotExist.
Operator LabelSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=LabelSelectorOperator"`
// values is an array of string values. If the operator is In or NotIn,
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
}
// A label selector operator is the set of operators that can be used in a selector requirement.
type LabelSelectorOperator string
const (
LabelSelectorOpIn LabelSelectorOperator = "In"
LabelSelectorOpNotIn LabelSelectorOperator = "NotIn"
LabelSelectorOpExists LabelSelectorOperator = "Exists"
LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist"
)
// +genclient=true // +genclient=true
// ReplicaSet represents the configuration of a ReplicaSet. // ReplicaSet represents the configuration of a ReplicaSet.
...@@ -983,7 +943,7 @@ type ReplicaSetSpec struct { ...@@ -983,7 +943,7 @@ type ReplicaSetSpec struct {
// Label keys and values that must match in order to be controlled by this replica set. // Label keys and values that must match in order to be controlled by this replica set.
// More info: http://kubernetes.io/docs/user-guide/labels#label-selectors // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
// +optional // +optional
Selector *LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"` Selector *unversioned.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
// Template is the object that describes the pod that will be created if // Template is the object that describes the pod that will be created if
// insufficient replicas are detected. // insufficient replicas are detected.
...@@ -1277,7 +1237,7 @@ type NetworkPolicySpec struct { ...@@ -1277,7 +1237,7 @@ type NetworkPolicySpec struct {
// same set of pods. In this case, the ingress rules for each are combined additively. // same set of pods. In this case, the ingress rules for each are combined additively.
// This field is NOT optional and follows standard label selector semantics. // This field is NOT optional and follows standard label selector semantics.
// An empty podSelector matches all pods in this namespace. // An empty podSelector matches all pods in this namespace.
PodSelector LabelSelector `json:"podSelector" protobuf:"bytes,1,opt,name=podSelector"` PodSelector unversioned.LabelSelector `json:"podSelector" protobuf:"bytes,1,opt,name=podSelector"`
// List of ingress rules to be applied to the selected pods. // List of ingress rules to be applied to the selected pods.
// Traffic is allowed to a pod if namespace.networkPolicy.ingress.isolation is undefined and cluster policy allows it, // Traffic is allowed to a pod if namespace.networkPolicy.ingress.isolation is undefined and cluster policy allows it,
...@@ -1337,7 +1297,7 @@ type NetworkPolicyPeer struct { ...@@ -1337,7 +1297,7 @@ type NetworkPolicyPeer struct {
// If not provided, this selector selects no pods. // If not provided, this selector selects no pods.
// If present but empty, this selector selects all pods in this namespace. // If present but empty, this selector selects all pods in this namespace.
// +optional // +optional
PodSelector *LabelSelector `json:"podSelector,omitempty" protobuf:"bytes,1,opt,name=podSelector"` PodSelector *unversioned.LabelSelector `json:"podSelector,omitempty" protobuf:"bytes,1,opt,name=podSelector"`
// Selects Namespaces using cluster scoped-labels. This // Selects Namespaces using cluster scoped-labels. This
// matches all pods in all namespaces selected by this label selector. // matches all pods in all namespaces selected by this label selector.
...@@ -1345,7 +1305,7 @@ type NetworkPolicyPeer struct { ...@@ -1345,7 +1305,7 @@ type NetworkPolicyPeer struct {
// If omitted, this selector selects no namespaces. // If omitted, this selector selects no namespaces.
// If present but empty, this selector selects all namespaces. // If present but empty, this selector selects all namespaces.
// +optional // +optional
NamespaceSelector *LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,2,opt,name=namespaceSelector"` NamespaceSelector *unversioned.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,2,opt,name=namespaceSelector"`
} }
// Network Policy List is a list of NetworkPolicy objects. // Network Policy List is a list of NetworkPolicy objects.
......
...@@ -423,27 +423,6 @@ func (JobStatus) SwaggerDoc() map[string]string { ...@@ -423,27 +423,6 @@ func (JobStatus) SwaggerDoc() map[string]string {
return map_JobStatus return map_JobStatus
} }
var map_LabelSelector = map[string]string{
"": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.",
"matchLabels": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
"matchExpressions": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
}
func (LabelSelector) SwaggerDoc() map[string]string {
return map_LabelSelector
}
var map_LabelSelectorRequirement = map[string]string{
"": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
"key": "key is the label key that the selector applies to.",
"operator": "operator represents a key's relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist.",
"values": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.",
}
func (LabelSelectorRequirement) SwaggerDoc() map[string]string {
return map_LabelSelectorRequirement
}
var map_NetworkPolicy = map[string]string{ var map_NetworkPolicy = map[string]string{
"metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", "metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
"spec": "Specification of the desired behavior for this NetworkPolicy.", "spec": "Specification of the desired behavior for this NetworkPolicy.",
......
...@@ -76,8 +76,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -76,8 +76,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobList, InType: reflect.TypeOf(&JobList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobList, InType: reflect.TypeOf(&JobList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobSpec, InType: reflect.TypeOf(&JobSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobSpec, InType: reflect.TypeOf(&JobSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobStatus, InType: reflect.TypeOf(&JobStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobStatus, InType: reflect.TypeOf(&JobStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_LabelSelector, InType: reflect.TypeOf(&LabelSelector{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_LabelSelectorRequirement, InType: reflect.TypeOf(&LabelSelectorRequirement{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicy, InType: reflect.TypeOf(&NetworkPolicy{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicy, InType: reflect.TypeOf(&NetworkPolicy{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicyIngressRule, InType: reflect.TypeOf(&NetworkPolicyIngressRule{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicyIngressRule, InType: reflect.TypeOf(&NetworkPolicyIngressRule{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicyList, InType: reflect.TypeOf(&NetworkPolicyList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicyList, InType: reflect.TypeOf(&NetworkPolicyList{})},
...@@ -228,8 +226,8 @@ func DeepCopy_v1beta1_DaemonSetSpec(in interface{}, out interface{}, c *conversi ...@@ -228,8 +226,8 @@ func DeepCopy_v1beta1_DaemonSetSpec(in interface{}, out interface{}, c *conversi
out := out.(*DaemonSetSpec) out := out.(*DaemonSetSpec)
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
*out = new(LabelSelector) *out = new(unversioned.LabelSelector)
if err := DeepCopy_v1beta1_LabelSelector(*in, *out, c); err != nil { if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err return err
} }
} else { } else {
...@@ -324,8 +322,8 @@ func DeepCopy_v1beta1_DeploymentSpec(in interface{}, out interface{}, c *convers ...@@ -324,8 +322,8 @@ func DeepCopy_v1beta1_DeploymentSpec(in interface{}, out interface{}, c *convers
} }
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
*out = new(LabelSelector) *out = new(unversioned.LabelSelector)
if err := DeepCopy_v1beta1_LabelSelector(*in, *out, c); err != nil { if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err return err
} }
} else { } else {
...@@ -780,8 +778,8 @@ func DeepCopy_v1beta1_JobSpec(in interface{}, out interface{}, c *conversion.Clo ...@@ -780,8 +778,8 @@ func DeepCopy_v1beta1_JobSpec(in interface{}, out interface{}, c *conversion.Clo
} }
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
*out = new(LabelSelector) *out = new(unversioned.LabelSelector)
if err := DeepCopy_v1beta1_LabelSelector(*in, *out, c); err != nil { if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err return err
} }
} else { } else {
...@@ -837,51 +835,6 @@ func DeepCopy_v1beta1_JobStatus(in interface{}, out interface{}, c *conversion.C ...@@ -837,51 +835,6 @@ func DeepCopy_v1beta1_JobStatus(in interface{}, out interface{}, c *conversion.C
} }
} }
func DeepCopy_v1beta1_LabelSelector(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelector)
out := out.(*LabelSelector)
if in.MatchLabels != nil {
in, out := &in.MatchLabels, &out.MatchLabels
*out = make(map[string]string)
for key, val := range *in {
(*out)[key] = val
}
} else {
out.MatchLabels = nil
}
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]LabelSelectorRequirement, len(*in))
for i := range *in {
if err := DeepCopy_v1beta1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
}
func DeepCopy_v1beta1_LabelSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelectorRequirement)
out := out.(*LabelSelectorRequirement)
out.Key = in.Key
out.Operator = in.Operator
if in.Values != nil {
in, out := &in.Values, &out.Values
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Values = nil
}
return nil
}
}
func DeepCopy_v1beta1_NetworkPolicy(in interface{}, out interface{}, c *conversion.Cloner) error { func DeepCopy_v1beta1_NetworkPolicy(in interface{}, out interface{}, c *conversion.Cloner) error {
{ {
in := in.(*NetworkPolicy) in := in.(*NetworkPolicy)
...@@ -954,8 +907,8 @@ func DeepCopy_v1beta1_NetworkPolicyPeer(in interface{}, out interface{}, c *conv ...@@ -954,8 +907,8 @@ func DeepCopy_v1beta1_NetworkPolicyPeer(in interface{}, out interface{}, c *conv
out := out.(*NetworkPolicyPeer) out := out.(*NetworkPolicyPeer)
if in.PodSelector != nil { if in.PodSelector != nil {
in, out := &in.PodSelector, &out.PodSelector in, out := &in.PodSelector, &out.PodSelector
*out = new(LabelSelector) *out = new(unversioned.LabelSelector)
if err := DeepCopy_v1beta1_LabelSelector(*in, *out, c); err != nil { if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err return err
} }
} else { } else {
...@@ -963,8 +916,8 @@ func DeepCopy_v1beta1_NetworkPolicyPeer(in interface{}, out interface{}, c *conv ...@@ -963,8 +916,8 @@ func DeepCopy_v1beta1_NetworkPolicyPeer(in interface{}, out interface{}, c *conv
} }
if in.NamespaceSelector != nil { if in.NamespaceSelector != nil {
in, out := &in.NamespaceSelector, &out.NamespaceSelector in, out := &in.NamespaceSelector, &out.NamespaceSelector
*out = new(LabelSelector) *out = new(unversioned.LabelSelector)
if err := DeepCopy_v1beta1_LabelSelector(*in, *out, c); err != nil { if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err return err
} }
} else { } else {
...@@ -1000,7 +953,7 @@ func DeepCopy_v1beta1_NetworkPolicySpec(in interface{}, out interface{}, c *conv ...@@ -1000,7 +953,7 @@ func DeepCopy_v1beta1_NetworkPolicySpec(in interface{}, out interface{}, c *conv
{ {
in := in.(*NetworkPolicySpec) in := in.(*NetworkPolicySpec)
out := out.(*NetworkPolicySpec) out := out.(*NetworkPolicySpec)
if err := DeepCopy_v1beta1_LabelSelector(&in.PodSelector, &out.PodSelector, c); err != nil { if err := unversioned.DeepCopy_unversioned_LabelSelector(&in.PodSelector, &out.PodSelector, c); err != nil {
return err return err
} }
if in.Ingress != nil { if in.Ingress != nil {
...@@ -1190,8 +1143,8 @@ func DeepCopy_v1beta1_ReplicaSetSpec(in interface{}, out interface{}, c *convers ...@@ -1190,8 +1143,8 @@ func DeepCopy_v1beta1_ReplicaSetSpec(in interface{}, out interface{}, c *convers
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = in.MinReadySeconds
if in.Selector != nil { if in.Selector != nil {
in, out := &in.Selector, &out.Selector in, out := &in.Selector, &out.Selector
*out = new(LabelSelector) *out = new(unversioned.LabelSelector)
if err := DeepCopy_v1beta1_LabelSelector(*in, *out, c); err != nil { if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err return err
} }
} else { } else {
......
...@@ -23,6 +23,7 @@ import ( ...@@ -23,6 +23,7 @@ import (
"k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_5" "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_5"
fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1" "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
...@@ -194,7 +195,7 @@ func newReplicaSet(namespace string, name string, replicas int32) *v1beta1.Repli ...@@ -194,7 +195,7 @@ func newReplicaSet(namespace string, name string, replicas int32) *v1beta1.Repli
}, },
Spec: v1beta1.ReplicaSetSpec{ Spec: v1beta1.ReplicaSetSpec{
Replicas: &replicas, Replicas: &replicas,
Selector: &v1beta1.LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: map[string]string{"name": "myrs"}, MatchLabels: map[string]string{"name": "myrs"},
}, },
Template: v1.PodTemplateSpec{ Template: v1.PodTemplateSpec{
......
...@@ -12,29 +12,6 @@ load( ...@@ -12,29 +12,6 @@ load(
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = ["main.go"],
"main.go", tags = ["automanaged"],
":bindata",
],
)
genrule(
name = "bindata",
srcs = [
"//examples:sources",
"//test/images:sources",
"//test/fixtures:sources",
"//test/e2e/testing-manifests:sources",
],
outs = ["bindata.go"],
cmd = """
$(location //vendor:github.com/jteeuwen/go-bindata/go-bindata) \
-nometadata -o "$(OUTS)" -pkg generated \
-prefix $$(pwd) \
-ignore .jpg -ignore .png -ignore .md \
$(SRCS)
""",
tools = [
"//vendor:github.com/jteeuwen/go-bindata/go-bindata",
],
) )
...@@ -55,7 +55,7 @@ func newRS(name, namespace string, replicas int) *v1beta1.ReplicaSet { ...@@ -55,7 +55,7 @@ func newRS(name, namespace string, replicas int) *v1beta1.ReplicaSet {
Name: name, Name: name,
}, },
Spec: v1beta1.ReplicaSetSpec{ Spec: v1beta1.ReplicaSetSpec{
Selector: &v1beta1.LabelSelector{ Selector: &unversioned.LabelSelector{
MatchLabels: testLabels(), MatchLabels: testLabels(),
}, },
Replicas: &replicasCopy, Replicas: &replicasCopy,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment