Skip to content

Commit

Permalink
renaming PodSelector to LabelSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
sdminonne committed Dec 4, 2015
1 parent a5100ef commit 80575c3
Show file tree
Hide file tree
Showing 32 changed files with 406 additions and 406 deletions.
18 changes: 9 additions & 9 deletions api/swagger-spec/v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2941,7 +2941,7 @@
"description": "Completions specifies the desired number of successfully finished pods the job should be run with. Defaults to 1. More info: http://releases.k8s.io/HEAD/docs/user-guide/jobs.md"
},
"selector": {
"$ref": "v1beta1.PodSelector",
"$ref": "v1beta1.LabelSelector",
"description": "Selector is a label query over pods that should match the pod count. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors"
},
"template": {
Expand All @@ -2950,9 +2950,9 @@
}
}
},
"v1beta1.PodSelector": {
"id": "v1beta1.PodSelector",
"description": "A pod selector is a label query over a set of pods. The result of matchLabels and matchExpressions are ANDed. An empty pod selector matches all objects. A null pod selector matches no objects.",
"v1beta1.LabelSelector": {
"id": "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": {
"matchLabels": {
"type": "any",
Expand All @@ -2961,15 +2961,15 @@
"matchExpressions": {
"type": "array",
"items": {
"$ref": "v1beta1.PodSelectorRequirement"
"$ref": "v1beta1.LabelSelectorRequirement"
},
"description": "matchExpressions is a list of pod selector requirements. The requirements are ANDed."
"description": "matchExpressions is a list of label selector requirements. The requirements are ANDed."
}
}
},
"v1beta1.PodSelectorRequirement": {
"id": "v1beta1.PodSelectorRequirement",
"description": "A pod selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
"v1beta1.LabelSelectorRequirement": {
"id": "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"
Expand Down
182 changes: 91 additions & 91 deletions docs/api-reference/extensions/v1beta1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -398,54 +398,6 @@ <h2 id="_top_level_api_objects">Top Level API Objects</h2>
<h2 id="_definitions">Definitions</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_v1beta1_podselectorrequirement">v1beta1.PodSelectorRequirement</h3>
<div class="paragraph">
<p>A pod selector requirement is a selector that contains values, a key, and an operator that relates the key and values.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">key</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">key is the label key that the selector applies to.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">operator</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">operator represents a key&#8217;s relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">values</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1beta1_job">v1beta1.Job</h3>
<div class="paragraph">
<p>Job represents the configuration of a single job.</p>
Expand Down Expand Up @@ -2090,6 +2042,47 @@ <h3 id="_v1_objectmeta">v1.ObjectMeta</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1beta1_labelselector">v1beta1.LabelSelector</h3>
<div class="paragraph">
<p>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.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">matchLabels</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_any">any</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">matchExpressions</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">matchExpressions is a list of label selector requirements. The requirements are ANDed.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1beta1_labelselectorrequirement">v1beta1.LabelSelectorRequirement</a> array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_hostpathvolumesource">v1.HostPathVolumeSource</h3>
Expand Down Expand Up @@ -2692,6 +2685,54 @@ <h3 id="_v1beta1_horizontalpodautoscalerspec">v1beta1.HorizontalPodAutoscalerSpe
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1beta1_labelselectorrequirement">v1beta1.LabelSelectorRequirement</h3>
<div class="paragraph">
<p>A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">key</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">key is the label key that the selector applies to.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">operator</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">operator represents a key&#8217;s relationship to a set of values. Valid operators ard In, NotIn, Exists and DoesNotExist.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">values</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1beta1_horizontalpodautoscaler">v1beta1.HorizontalPodAutoscaler</h3>
Expand Down Expand Up @@ -3385,7 +3426,7 @@ <h3 id="_v1beta1_jobspec">v1beta1.JobSpec</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">selector</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Selector is a label query over pods that should match the pod count. More info: <a href="http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors">http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1beta1_podselector">v1beta1.PodSelector</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1beta1_labelselector">v1beta1.LabelSelector</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
Expand All @@ -3398,47 +3439,6 @@ <h3 id="_v1beta1_jobspec">v1beta1.JobSpec</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1beta1_podselector">v1beta1.PodSelector</h3>
<div class="paragraph">
<p>A pod selector is a label query over a set of pods. The result of matchLabels and matchExpressions are ANDed. An empty pod selector matches all objects. A null pod selector matches no objects.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">matchLabels</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_any">any</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">matchExpressions</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">matchExpressions is a list of pod selector requirements. The requirements are ANDed.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1beta1_podselectorrequirement">v1beta1.PodSelectorRequirement</a> array</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_capability">v1.Capability</h3>
Expand Down Expand Up @@ -4268,7 +4268,7 @@ <h3 id="_any">any</h3>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2015-11-29 16:46:22 UTC
Last updated 2015-12-01 22:09:32 UTC
</div>
</div>
</body>
Expand Down
32 changes: 16 additions & 16 deletions pkg/apis/extensions/deep_copy_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -982,8 +982,8 @@ func deepCopy_extensions_DaemonSetList(in DaemonSetList, out *DaemonSetList, c *

func deepCopy_extensions_DaemonSetSpec(in DaemonSetSpec, out *DaemonSetSpec, c *conversion.Cloner) error {
if in.Selector != nil {
out.Selector = new(PodSelector)
if err := deepCopy_extensions_PodSelector(*in.Selector, out.Selector, c); err != nil {
out.Selector = new(LabelSelector)
if err := deepCopy_extensions_LabelSelector(*in.Selector, out.Selector, c); err != nil {
return err
}
} else {
Expand Down Expand Up @@ -1345,8 +1345,8 @@ func deepCopy_extensions_JobSpec(in JobSpec, out *JobSpec, c *conversion.Cloner)
out.Completions = nil
}
if in.Selector != nil {
out.Selector = new(PodSelector)
if err := deepCopy_extensions_PodSelector(*in.Selector, out.Selector, c); err != nil {
out.Selector = new(LabelSelector)
if err := deepCopy_extensions_LabelSelector(*in.Selector, out.Selector, c); err != nil {
return err
}
} else {
Expand Down Expand Up @@ -1391,13 +1391,7 @@ func deepCopy_extensions_JobStatus(in JobStatus, out *JobStatus, c *conversion.C
return nil
}

func deepCopy_extensions_NodeUtilization(in NodeUtilization, out *NodeUtilization, c *conversion.Cloner) error {
out.Resource = in.Resource
out.Value = in.Value
return nil
}

func deepCopy_extensions_PodSelector(in PodSelector, out *PodSelector, c *conversion.Cloner) error {
func deepCopy_extensions_LabelSelector(in LabelSelector, out *LabelSelector, c *conversion.Cloner) error {
if in.MatchLabels != nil {
out.MatchLabels = make(map[string]string)
for key, val := range in.MatchLabels {
Expand All @@ -1407,9 +1401,9 @@ func deepCopy_extensions_PodSelector(in PodSelector, out *PodSelector, c *conver
out.MatchLabels = nil
}
if in.MatchExpressions != nil {
out.MatchExpressions = make([]PodSelectorRequirement, len(in.MatchExpressions))
out.MatchExpressions = make([]LabelSelectorRequirement, len(in.MatchExpressions))
for i := range in.MatchExpressions {
if err := deepCopy_extensions_PodSelectorRequirement(in.MatchExpressions[i], &out.MatchExpressions[i], c); err != nil {
if err := deepCopy_extensions_LabelSelectorRequirement(in.MatchExpressions[i], &out.MatchExpressions[i], c); err != nil {
return err
}
}
Expand All @@ -1419,7 +1413,7 @@ func deepCopy_extensions_PodSelector(in PodSelector, out *PodSelector, c *conver
return nil
}

func deepCopy_extensions_PodSelectorRequirement(in PodSelectorRequirement, out *PodSelectorRequirement, c *conversion.Cloner) error {
func deepCopy_extensions_LabelSelectorRequirement(in LabelSelectorRequirement, out *LabelSelectorRequirement, c *conversion.Cloner) error {
out.Key = in.Key
out.Operator = in.Operator
if in.Values != nil {
Expand All @@ -1433,6 +1427,12 @@ func deepCopy_extensions_PodSelectorRequirement(in PodSelectorRequirement, out *
return nil
}

func deepCopy_extensions_NodeUtilization(in NodeUtilization, out *NodeUtilization, c *conversion.Cloner) error {
out.Resource = in.Resource
out.Value = in.Value
return nil
}

func deepCopy_extensions_ReplicationControllerDummy(in ReplicationControllerDummy, out *ReplicationControllerDummy, c *conversion.Cloner) error {
if err := deepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
Expand Down Expand Up @@ -1659,9 +1659,9 @@ func init() {
deepCopy_extensions_JobList,
deepCopy_extensions_JobSpec,
deepCopy_extensions_JobStatus,
deepCopy_extensions_LabelSelector,
deepCopy_extensions_LabelSelectorRequirement,
deepCopy_extensions_NodeUtilization,
deepCopy_extensions_PodSelector,
deepCopy_extensions_PodSelectorRequirement,
deepCopy_extensions_ReplicationControllerDummy,
deepCopy_extensions_RollingUpdateDeployment,
deepCopy_extensions_Scale,
Expand Down
12 changes: 6 additions & 6 deletions pkg/apis/extensions/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"k8s.io/kubernetes/pkg/util/sets"
)

// PodSelectorAsSelector converts the PodSelector api type into a struct that implements
// LabelSelectorAsSelector converts the LabelSelector api type into a struct that implements
// labels.Selector
func PodSelectorAsSelector(ps *PodSelector) (labels.Selector, error) {
func LabelSelectorAsSelector(ps *LabelSelector) (labels.Selector, error) {
if ps == nil {
return labels.Nothing(), nil
}
Expand All @@ -45,13 +45,13 @@ func PodSelectorAsSelector(ps *PodSelector) (labels.Selector, error) {
for _, expr := range ps.MatchExpressions {
var op labels.Operator
switch expr.Operator {
case PodSelectorOpIn:
case LabelSelectorOpIn:
op = labels.InOperator
case PodSelectorOpNotIn:
case LabelSelectorOpNotIn:
op = labels.NotInOperator
case PodSelectorOpExists:
case LabelSelectorOpExists:
op = labels.ExistsOperator
case PodSelectorOpDoesNotExist:
case LabelSelectorOpDoesNotExist:
op = labels.DoesNotExistOperator
default:
return nil, fmt.Errorf("%q is not a valid pod selector operator", expr.Operator)
Expand Down
Loading

0 comments on commit 80575c3

Please sign in to comment.