summaryrefslogtreecommitdiff
path: root/vendor/k8s.io/apimachinery/pkg/labels
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2020-12-09 09:17:32 +0000
committerDaniel J Walsh <dwalsh@redhat.com>2020-12-09 06:05:03 -0500
commit37fbf28d74927b959b36ceade7fde3402ea08e05 (patch)
treed053b6a2fd3e05946bbf71134d80efcb9a8a449c /vendor/k8s.io/apimachinery/pkg/labels
parentdd295f297b6dd51d22c64c75f4ef4f80f953bbde (diff)
downloadpodman-37fbf28d74927b959b36ceade7fde3402ea08e05.tar.gz
podman-37fbf28d74927b959b36ceade7fde3402ea08e05.tar.bz2
podman-37fbf28d74927b959b36ceade7fde3402ea08e05.zip
Bump k8s.io/apimachinery from 0.19.4 to 0.20.0
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.19.4 to 0.20.0. - [Release notes](https://github.com/kubernetes/apimachinery/releases) - [Commits](https://github.com/kubernetes/apimachinery/compare/v0.19.4...v0.20.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/k8s.io/apimachinery/pkg/labels')
-rw-r--r--vendor/k8s.io/apimachinery/pkg/labels/labels.go19
-rw-r--r--vendor/k8s.io/apimachinery/pkg/labels/selector.go50
2 files changed, 25 insertions, 44 deletions
diff --git a/vendor/k8s.io/apimachinery/pkg/labels/labels.go b/vendor/k8s.io/apimachinery/pkg/labels/labels.go
index d9eeb4f91..d6bbeeaca 100644
--- a/vendor/k8s.io/apimachinery/pkg/labels/labels.go
+++ b/vendor/k8s.io/apimachinery/pkg/labels/labels.go
@@ -141,25 +141,6 @@ func Equals(labels1, labels2 Set) bool {
return true
}
-// AreLabelsInWhiteList verifies if the provided label list
-// is in the provided whitelist and returns true, otherwise false.
-func AreLabelsInWhiteList(labels, whitelist Set) bool {
- if len(whitelist) == 0 {
- return true
- }
-
- for k, v := range labels {
- value, ok := whitelist[k]
- if !ok {
- return false
- }
- if value != v {
- return false
- }
- }
- return true
-}
-
// ConvertSelectorToLabelsMap converts selector string to labels map
// and validates keys and values
func ConvertSelectorToLabelsMap(selector string) (Set, error) {
diff --git a/vendor/k8s.io/apimachinery/pkg/labels/selector.go b/vendor/k8s.io/apimachinery/pkg/labels/selector.go
index bf62f98a4..50ae4f7ce 100644
--- a/vendor/k8s.io/apimachinery/pkg/labels/selector.go
+++ b/vendor/k8s.io/apimachinery/pkg/labels/selector.go
@@ -263,11 +263,11 @@ func (r *Requirement) Values() sets.String {
}
// Empty returns true if the internalSelector doesn't restrict selection space
-func (lsel internalSelector) Empty() bool {
- if lsel == nil {
+func (s internalSelector) Empty() bool {
+ if s == nil {
return true
}
- return len(lsel) == 0
+ return len(s) == 0
}
// String returns a human-readable string that represents this
@@ -330,51 +330,51 @@ func safeSort(in []string) []string {
}
// Add adds requirements to the selector. It copies the current selector returning a new one
-func (lsel internalSelector) Add(reqs ...Requirement) Selector {
- var sel internalSelector
- for ix := range lsel {
- sel = append(sel, lsel[ix])
+func (s internalSelector) Add(reqs ...Requirement) Selector {
+ var ret internalSelector
+ for ix := range s {
+ ret = append(ret, s[ix])
}
for _, r := range reqs {
- sel = append(sel, r)
+ ret = append(ret, r)
}
- sort.Sort(ByKey(sel))
- return sel
+ sort.Sort(ByKey(ret))
+ return ret
}
// Matches for a internalSelector returns true if all
// its Requirements match the input Labels. If any
// Requirement does not match, false is returned.
-func (lsel internalSelector) Matches(l Labels) bool {
- for ix := range lsel {
- if matches := lsel[ix].Matches(l); !matches {
+func (s internalSelector) Matches(l Labels) bool {
+ for ix := range s {
+ if matches := s[ix].Matches(l); !matches {
return false
}
}
return true
}
-func (lsel internalSelector) Requirements() (Requirements, bool) { return Requirements(lsel), true }
+func (s internalSelector) Requirements() (Requirements, bool) { return Requirements(s), true }
// String returns a comma-separated string of all
// the internalSelector Requirements' human-readable strings.
-func (lsel internalSelector) String() string {
+func (s internalSelector) String() string {
var reqs []string
- for ix := range lsel {
- reqs = append(reqs, lsel[ix].String())
+ for ix := range s {
+ reqs = append(reqs, s[ix].String())
}
return strings.Join(reqs, ",")
}
// RequiresExactMatch introspect whether a given selector requires a single specific field
// to be set, and if so returns the value it requires.
-func (lsel internalSelector) RequiresExactMatch(label string) (value string, found bool) {
- for ix := range lsel {
- if lsel[ix].key == label {
- switch lsel[ix].operator {
+func (s internalSelector) RequiresExactMatch(label string) (value string, found bool) {
+ for ix := range s {
+ if s[ix].key == label {
+ switch s[ix].operator {
case selection.Equals, selection.DoubleEquals, selection.In:
- if len(lsel[ix].strValues) == 1 {
- return lsel[ix].strValues[0], true
+ if len(s[ix].strValues) == 1 {
+ return s[ix].strValues[0], true
}
}
return "", false
@@ -789,12 +789,12 @@ func (p *Parser) parseIdentifiersList() (sets.String, error) {
// parseExactValue parses the only value for exact match style
func (p *Parser) parseExactValue() (sets.String, error) {
s := sets.NewString()
- tok, lit := p.lookahead(Values)
+ tok, _ := p.lookahead(Values)
if tok == EndOfStringToken || tok == CommaToken {
s.Insert("")
return s, nil
}
- tok, lit = p.consume(Values)
+ tok, lit := p.consume(Values)
if tok == IdentifierToken {
s.Insert(lit)
return s, nil