summaryrefslogtreecommitdiff
path: root/vendor/k8s.io/apimachinery/pkg/fields
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-03-26 18:26:55 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-27 18:09:12 +0000
commitaf64e10400f8533a0c48ecdf5ab9b7fbf329e14e (patch)
tree59160e3841b440dd35189c724bbb4375a7be173b /vendor/k8s.io/apimachinery/pkg/fields
parent26d7e3c7b85e28c4e42998c90fdcc14079f13eef (diff)
downloadpodman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.tar.gz
podman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.tar.bz2
podman-af64e10400f8533a0c48ecdf5ab9b7fbf329e14e.zip
Vendor in lots of kubernetes stuff to shrink image size
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #554 Approved by: mheon
Diffstat (limited to 'vendor/k8s.io/apimachinery/pkg/fields')
-rw-r--r--vendor/k8s.io/apimachinery/pkg/fields/selector.go34
1 files changed, 33 insertions, 1 deletions
diff --git a/vendor/k8s.io/apimachinery/pkg/fields/selector.go b/vendor/k8s.io/apimachinery/pkg/fields/selector.go
index 1305dde08..3785d8c2f 100644
--- a/vendor/k8s.io/apimachinery/pkg/fields/selector.go
+++ b/vendor/k8s.io/apimachinery/pkg/fields/selector.go
@@ -50,6 +50,9 @@ type Selector interface {
// String returns a human readable string that represents this selector.
String() string
+
+ // Make a deep copy of the selector.
+ DeepCopySelector() Selector
}
// Everything returns a selector that matches all fields.
@@ -99,6 +102,15 @@ func (t *hasTerm) String() string {
return fmt.Sprintf("%v=%v", t.field, EscapeValue(t.value))
}
+func (t *hasTerm) DeepCopySelector() Selector {
+ if t == nil {
+ return nil
+ }
+ out := new(hasTerm)
+ *out = *t
+ return out
+}
+
type notHasTerm struct {
field, value string
}
@@ -138,6 +150,15 @@ func (t *notHasTerm) String() string {
return fmt.Sprintf("%v!=%v", t.field, EscapeValue(t.value))
}
+func (t *notHasTerm) DeepCopySelector() Selector {
+ if t == nil {
+ return nil
+ }
+ out := new(notHasTerm)
+ *out = *t
+ return out
+}
+
type andTerm []Selector
func (t andTerm) Matches(ls Fields) bool {
@@ -207,6 +228,17 @@ func (t andTerm) String() string {
return strings.Join(terms, ",")
}
+func (t andTerm) DeepCopySelector() Selector {
+ if t == nil {
+ return nil
+ }
+ out := make([]Selector, len(t))
+ for i := range t {
+ out[i] = t[i].DeepCopySelector()
+ }
+ return andTerm(out)
+}
+
// SelectorFromSet returns a Selector which will match exactly the given Set. A
// nil Set is considered equivalent to Everything().
func SelectorFromSet(ls Set) Selector {
@@ -364,7 +396,7 @@ const (
var termOperators = []string{notEqualOperator, doubleEqualOperator, equalOperator}
// splitTerm returns the lhs, operator, and rhs parsed from the given term, along with an indicator of whether the parse was successful.
-// no escaping of special characters is supported in the lhs value, so the first occurance of a recognized operator is used as the split point.
+// no escaping of special characters is supported in the lhs value, so the first occurrence of a recognized operator is used as the split point.
// the literal rhs is returned, and the caller is responsible for applying any desired unescaping.
func splitTerm(term string) (lhs, op, rhs string, ok bool) {
for i := range term {