Commit Graph

86 Commits (479ff417b87af82afa90c4da41d2ae4a2c105ffb)

Author SHA1 Message Date
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Wojciech Tyczynski 9c91da7a22 More efficient selector 2016-10-20 15:16:58 +02:00
Avesh Agarwal 5bb2cb8249 Added new unit tests. 2016-10-13 13:15:19 -04:00
Avesh Agarwal b902f857c6 Add support for admission controller based on namespace node selectors.
This work is to upstream openshift's project node selectors based admission controller.

Addresses #17151.
2016-10-13 13:14:19 -04:00
Wojciech Tyczynski e9d5be628a Don't validate selector that is already validated 2016-08-22 09:39:32 +02:00
Wojciech Tyczynski 42aee3ac5e Allow for selector creation without validation 2016-08-22 09:39:32 +02:00
Hongchao Deng 1871a22039 make labels, fields expose selectable requirements 2016-08-20 10:10:51 -07:00
Michal Rostecki 59ca5986dd Print/log pointers of structs with %#v instead of %+v
There are many places in k8s where %+v is used to format a pointer
to struct, which isn't working as expected.

Fixes #26591
2016-08-01 22:27:56 +02:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
k8s-merge-robot 0c696dc95b Merge pull request #27848 from liubin/fix-typos
Automatic merge from submit-queue

fix some typos

Just a minor typos fix.


Signed-off-by: bin liu <liubin0329@gmail.com>
2016-07-06 23:36:49 -07:00
Hongchao Deng 7127915a66 selector: make sure value of GT and LT is integer 2016-07-04 20:18:17 -07:00
bin liu 426fdc431a Merge branch 'master' into fix-typos 2016-07-04 11:20:47 +08:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
bin liu fd27cd47f7 fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-22 18:14:26 +08:00
Clayton Coleman e1dc3ef933
Remove unused deep_copies 2016-06-06 17:18:22 -04:00
Tim Hockin 66d0d87829 Make IsValidLabelValue return error strings 2016-05-17 21:36:10 -07:00
Tim Hockin 72955770f3 Make IsQualifiedName return error strings 2016-05-10 11:23:23 -07:00
Wojciech Tyczynski e610c137c0 Regenerate auto-generated files 2016-03-17 09:30:02 +01:00
Madhusudan.C.S fe26381c90 Support for both map-based and set-based selectors in extensions/v1beta1.Scale
Here are a list of changes along with an explanation of how they work:
1. Add a new string field called TargetSelector to the external version of
   extensions Scale type (extensions/v1beta1.Scale). This is a serialized
   version of either the map-based selector (in case of ReplicationControllers)
   or the unversioned.LabelSelector struct (in case of Deployments and
   ReplicaSets).
2. Change the selector field in the internal Scale type (extensions.Scale) to
   unversioned.LabelSelector.
3. Add conversion functions to convert from two external selector fields to a
   single internal selector field. The rules for conversion are as follows:
   i.   If the target resource that this scale targets supports LabelSelector
        (Deployments and ReplicaSets), then serialize the LabelSelector and
        store the string in the TargetSelector field in the external version
        and leave the map-based Selector field as nil.
   ii.  If the target resource only supports a map-based selector
        (ReplicationControllers), then still serialize that selector and
	store the serialized string in the TargetSelector field. Also,
	set the the Selector map field in the external Scale type.
   iii. When converting from external to internal version, parse the
        TargetSelector string into LabelSelector struct if the string isn't
	empty. If it is empty, then check if the Selector map is set and just
	assign that map to the MatchLabels component of the LabelSelector.
   iv.  When converting from internal to external version, serialize the
        LabelSelector and store it in the TargetSelector field. If only
	the MatchLabel component is set, then also copy that value to
	the Selector map field in the external version.
4. HPA now just converts the LabelSelector field to a Selector interface
   type to list the pods.
5. Scale Get and Update etcd methods for Deployments and ReplicaSets now
   return extensions.Scale instead of autoscaling.Scale.
6. Consequently, SubresourceGroupVersion override and is "autoscaling"
   enabled check is now removed from pkg/master/master.go
7. Other small changes to labels package, fuzzer and LabelSelector
   helpers to piece this all together.
8. Add unit tests to HPA targeting Deployments and ReplicaSets.
9. Add an e2e test to HPA targeting ReplicaSets.
2016-03-09 17:54:17 -08:00
Madhusudan.C.S 6b34a2bac6 Selector operator strings should all be lowercase to be consistent with other operators. 2016-03-09 10:02:37 -08:00
Kevin c8c82c1d8f implement Node affinity and NodeSelector 2016-02-04 01:53:14 +00:00
k8s-merge-robot 20b4fa6fbd Merge pull request #18494 from brendandburns/perf3
Auto commit by PR queue bot
2015-12-16 15:01:10 -08:00
k8s-merge-robot 91ef756bea Merge pull request #18423 from tombenner/improve_label_validation_error_messages
Auto commit by PR queue bot
2015-12-16 14:08:21 -08:00
Brendan Burns beda3fd92d Switch to index rather than copy indexing.
This was 17% of all allocations on a recent profile.
2015-12-14 20:17:02 -08:00
David Oppenheimer 725a84ffe0 Merge pull request #18157 from sdminonne/LabelSelector_internalSelector
renaming labels.LabelSelector to labels.internalSelector
2015-12-13 20:03:49 -08:00
Tom Benner c354c12712 Improve label selector validations' error messages 2015-12-09 00:45:31 -08:00
Salvatore Dario Minonne 3288ce0dcb renaming labels.LabelSelector to labels.internalSelector 2015-12-04 09:21:33 +01:00
Tim Hockin e6df0b1a24 Convert validation to use FieldPath
Before this change we have a mish-mash of ways to pass field names around for
error generation.  Sometimes string fieldnames, sometimes .Prefix(), sometimes
neither, often wrong names or not indexed when it should be.

Instead of that mess, this is part one of a couple of commits that will make it
more strongly typed and hopefully encourage correct behavior.  At least you
will have to think about field names, which is better than nothing.

It turned out to be really hard to do this incrementally.
2015-12-03 08:19:44 -08:00
Tim Hockin ceee678b29 Rename validation 'New' funcs 2015-11-23 10:01:43 -08:00
Tim Hockin 0ff66da346 Move fielderrors into validation 2015-11-22 20:12:20 -08:00
Wojciech Tyczynski 975871e0a0 JSON marshaling/unmarshaling of label Selector 2015-11-19 16:44:48 +01:00
Mike Danese 29c50cdc1a plumb PodSelector through the api 2015-10-15 07:42:57 -07:00
Brian Grant 1bac67f9e2 Add DoesNotExist label operator. 2015-10-13 20:13:19 +00:00
tummychow b9ff3a0741 Add getters for labels.Requirement
Useful for some label backends that need access to the fields.
2015-10-05 11:48:20 -07:00
Chao Xu 9be421c053 fix label selector parser in case no value (or only whitespaces) is specified after the key 2015-10-02 16:17:56 -07:00
tummychow a21c52a766 Move util/validation files to their own package 2015-09-13 00:46:52 -07:00
tummychow 78ce5da988 Move util.StringSet into its own package
A lot of packages use StringSet, but they don't use anything else from
the util package. Moving StringSet into another package will shrink
their dependency trees significantly.
2015-09-10 12:04:15 -07:00
Steve Kuznetsov 0a07a46100 fixed error typo 2015-09-03 09:28:02 -04:00
hurf 36987e9dce Move formatLabels function to labels package
As the TODO above the function instructed, move formatLables
function to labels package.
2015-08-23 18:27:48 +08:00
Kris Rousey 565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Maciej Szulik a11911d20d Fixed notin operator in labels' selectors comments. 2015-07-03 17:33:46 +02:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Prashanth Balasubramanian 7592dabeba RcManager uses informers 2015-04-28 13:45:15 -07:00
Kris Rousey 6904c4d585 Fixing a lot of string formatting issues with regards to:
* Improper format specifier (e.g. %s for bools or %s for ints)
  * More or less parameters than format specifiers
  * Not calling a formatting function when it should have (e.g. Error() instead of Errorf())
2015-03-31 16:47:10 -07:00
Salvatore Dario Minonne 6ad5c07350 Adding a func to labels.Selector to add requirement 2015-03-25 20:37:04 +01:00
Nikhil Jindal 5c71e2ba00 Merge pull request #5769 from sdminonne/cleaning_labels
Removing dead code in labels package and changing LabelSelector type
2015-03-23 16:28:31 -07:00
Clayton Coleman 65425f690c Move field errors to pkg/util/fielderrors
Allows pkg/api to take a reference to labels.Selector and fields.Selector
2015-03-22 17:43:34 -04:00
Salvatore Dario Minonne 4c55689fb7 Removing dead code in labels package and chaning LabelSelector type 2015-03-22 18:03:50 +01:00
gmarek bb8a4f5ed3 apply comments 2015-03-06 08:23:22 +01:00