Update generated files under kyaml.

sed -i 's|version: v0.17.0|version: v0.19.8|' kyaml/yaml/internal/k8sgen/k8scopy.yaml
rm kyaml/yaml/internal/k8sgen/pkg/labels/zz_generated.deepcopy.go
(cd kyaml; make generate)
This commit is contained in:
monopole
2021-02-28 10:10:31 -08:00
parent 508f294e0c
commit 2e6ef91a7c
14 changed files with 126 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
// Code generated by k8scopy from k8s.io/apimachinery@v0.17.0; DO NOT EDIT.
// Copied from k8s.io/apimachinery@v0.17.0/pkg/labels/selector.go
// Code generated by k8scopy from k8s.io/apimachinery@v0.19.8; DO NOT EDIT.
// File content copied from k8s.io/apimachinery@v0.19.8/pkg/labels/selector.go
/*
Copyright 2014 The Kubernetes Authors.
@@ -225,7 +225,7 @@ func (r *Requirement) Matches(ls Labels) bool {
return false
}
// There should be only one strValue in r.strValues, and can be converted to a integer.
// There should be only one strValue in r.strValues, and can be converted to an integer.
if len(r.strValues) != 1 {
log.Printf("Invalid values count %+v of requirement %#v, for 'Gt', 'Lt' operators, exactly one value is required", len(r.strValues), r)
return false
@@ -873,23 +873,30 @@ func validateLabelValue(k, v string) error {
// SelectorFromSet returns a Selector which will match exactly the given Set. A
// nil and empty Sets are considered equivalent to Everything().
// It does not perform any validation, which means the server will reject
// the request if the Set contains invalid values.
func SelectorFromSet(ls Set) Selector {
return SelectorFromValidatedSet(ls)
}
// ValidatedSelectorFromSet returns a Selector which will match exactly the given Set. A
// nil and empty Sets are considered equivalent to Everything().
// The Set is validated client-side, which allows to catch errors early.
func ValidatedSelectorFromSet(ls Set) (Selector, error) {
if ls == nil || len(ls) == 0 {
return internalSelector{}
return internalSelector{}, nil
}
requirements := make([]Requirement, 0, len(ls))
for label, value := range ls {
r, err := NewRequirement(label, selection.Equals, []string{value})
if err == nil {
requirements = append(requirements, *r)
} else {
//TODO: double check errors when input comes from serialization?
return internalSelector{}
if err != nil {
return nil, err
}
requirements = append(requirements, *r)
}
// sort to have deterministic string representation
sort.Sort(ByKey(requirements))
return internalSelector(requirements)
return internalSelector(requirements), nil
}
// SelectorFromValidatedSet returns a Selector which will match exactly the given Set.