Skip to content

Commit 7fe1e07

Browse files
authored
Update to Kubernetes v1.18.3 (#25)
Signed-off-by: 1gtm <1gtm@appscode.com>
1 parent 66b3b46 commit 7fe1e07

File tree

5 files changed

+44
-9
lines changed

5 files changed

+44
-9
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
k8s.io/client-go v12.0.0+incompatible
1717
k8s.io/component-base v0.18.3
1818
k8s.io/kubectl v0.18.3
19-
kmodules.xyz/client-go v0.0.0-20200525195850-2fd180961371
19+
kmodules.xyz/client-go v0.0.0-20200630053911-20d035822d35
2020
kmodules.xyz/custom-resources v0.0.0-20200604135349-9e9f5c4fdba9 // indirect
2121
kmodules.xyz/objectstore-api v0.0.0-20200521103120-92080446e04d
2222
kmodules.xyz/offshoot-api v0.0.0-20200521035628-e135bf07b226

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,8 @@ kmodules.xyz/client-go v0.0.0-20200522120609-c6430d66212f h1:8UjB4zeASqedORHWpGo
958958
kmodules.xyz/client-go v0.0.0-20200522120609-c6430d66212f/go.mod h1:sY/eoe4ktxZEoHpr5NpAQ5s22VSwTE8psJtKVeVgLRY=
959959
kmodules.xyz/client-go v0.0.0-20200525195850-2fd180961371 h1:PPawDOMyDHGeDPN8j1epNozaIB/Z7MlJsXpwm/r4jgk=
960960
kmodules.xyz/client-go v0.0.0-20200525195850-2fd180961371/go.mod h1:sY/eoe4ktxZEoHpr5NpAQ5s22VSwTE8psJtKVeVgLRY=
961+
kmodules.xyz/client-go v0.0.0-20200630053911-20d035822d35 h1:gDzZWVvgAaEBzo4lxMGhPUWqySgFyFDkcqw3NskZiwQ=
962+
kmodules.xyz/client-go v0.0.0-20200630053911-20d035822d35/go.mod h1:sY/eoe4ktxZEoHpr5NpAQ5s22VSwTE8psJtKVeVgLRY=
961963
kmodules.xyz/constants v0.0.0-20200506032633-a21e58ceec72/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY=
962964
kmodules.xyz/crd-schema-fuzz v0.0.0-20200521005638-2433a187de95/go.mod h1:jpu8xFsDKd6kAWUAKk8oTu/GQGBWqhrcaDeOJdaCJnk=
963965
kmodules.xyz/custom-resources v0.0.0-20200521070540-2221c4957ef6 h1:7FNWsFr2umNrleWVyyI4Jn+VSqOknwpm/ztzuK6hpKA=

vendor/kmodules.xyz/client-go/apiextensions/kubernetes.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ func RegisterCRDs(client crd_cs.Interface, crds []*CustomResourceDefinition) err
5454
client,
5555
crd.V1.Name,
5656
func(in *crdv1.CustomResourceDefinition) *crdv1.CustomResourceDefinition {
57-
in.Labels = meta_util.MergeKeys(in.Labels, crd.V1.Labels)
58-
in.Annotations = meta_util.MergeKeys(in.Annotations, crd.V1.Annotations)
57+
in.Labels = meta_util.OverwriteKeys(in.Labels, crd.V1.Labels)
58+
in.Annotations = meta_util.OverwriteKeys(in.Annotations, crd.V1.Annotations)
5959

6060
in.Spec = crd.V1.Spec
6161
return in
@@ -86,8 +86,8 @@ func RegisterCRDs(client crd_cs.Interface, crds []*CustomResourceDefinition) err
8686
client,
8787
crd.V1beta1.Name,
8888
func(in *crdv1beta1.CustomResourceDefinition) *crdv1beta1.CustomResourceDefinition {
89-
in.Labels = meta_util.MergeKeys(in.Labels, crd.V1beta1.Labels)
90-
in.Annotations = meta_util.MergeKeys(in.Annotations, crd.V1beta1.Annotations)
89+
in.Labels = meta_util.OverwriteKeys(in.Labels, crd.V1beta1.Labels)
90+
in.Annotations = meta_util.OverwriteKeys(in.Annotations, crd.V1beta1.Annotations)
9191

9292
in.Spec = crd.V1beta1.Spec
9393
return in

vendor/kmodules.xyz/client-go/meta/lib.go

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,32 @@ func MergeKeys(out, in map[string]string) map[string]string {
109109
out = make(map[string]string, len(in))
110110
}
111111

112+
for k, v := range in {
113+
if _, ok := out[k]; !ok {
114+
out[k] = v
115+
}
116+
}
117+
return out
118+
}
119+
120+
func OverwriteKeys(out, in map[string]string) map[string]string {
121+
if in == nil {
122+
return out
123+
}
124+
if out == nil {
125+
out = make(map[string]string, len(in))
126+
}
127+
112128
for k, v := range in {
113129
out[k] = v
114130
}
115131
return out
116132
}
117133

134+
func NameWithPrefix(prefix, name string, customLength ...int) string {
135+
return ValidNameWithPrefix(prefix, name, customLength...)
136+
}
137+
118138
func ValidNameWithPrefix(prefix, name string, customLength ...int) string {
119139
maxLength := validation.DNS1123LabelMaxLength
120140
if len(customLength) != 0 {
@@ -124,6 +144,19 @@ func ValidNameWithPrefix(prefix, name string, customLength ...int) string {
124144
return strings.Trim(out[:min(maxLength, len(out))], "-")
125145
}
126146

147+
func NameWithSuffix(name, suffix string, customLength ...int) string {
148+
maxLength := validation.DNS1123LabelMaxLength
149+
if len(customLength) != 0 {
150+
maxLength = customLength[0]
151+
}
152+
if len(suffix) >= maxLength {
153+
return strings.Trim(suffix[max(0, len(suffix)-maxLength):], "-")
154+
}
155+
out := fmt.Sprintf("%s-%s", name[:min(len(name), maxLength-len(suffix)-1)], suffix)
156+
return strings.Trim(out, "-")
157+
}
158+
159+
// Deprecated: Use NameWithSuffix in new code
127160
func ValidNameWithSuffix(name, suffix string, customLength ...int) string {
128161
maxLength := validation.DNS1123LabelMaxLength
129162
if len(customLength) != 0 {
@@ -133,7 +166,7 @@ func ValidNameWithSuffix(name, suffix string, customLength ...int) string {
133166
return strings.Trim(out[max(0, len(out)-maxLength):], "-")
134167
}
135168

136-
func ValidNameWithPefixNSuffix(prefix, name, suffix string, customLength ...int) string {
169+
func ValidNameWithPrefixNSuffix(prefix, name, suffix string, customLength ...int) string {
137170
maxLength := validation.DNS1123LabelMaxLength
138171
if len(customLength) != 0 {
139172
maxLength = customLength[0]
@@ -154,8 +187,8 @@ func ValidCronJobNameWithSuffix(name, suffix string) string {
154187
return ValidNameWithSuffix(name, suffix, MaxCronJobNameLength)
155188
}
156189

157-
func ValidCronJobNameWithPefixNSuffix(prefix, name, suffix string) string {
158-
return ValidNameWithPefixNSuffix(prefix, name, suffix, MaxCronJobNameLength)
190+
func ValidCronJobNameWithPrefixNSuffix(prefix, name, suffix string) string {
191+
return ValidNameWithPrefixNSuffix(prefix, name, suffix, MaxCronJobNameLength)
159192
}
160193

161194
func min(x, y int) int {

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ k8s.io/utils/integer
539539
k8s.io/utils/io
540540
k8s.io/utils/pointer
541541
k8s.io/utils/trace
542-
# kmodules.xyz/client-go v0.0.0-20200525195850-2fd180961371
542+
# kmodules.xyz/client-go v0.0.0-20200630053911-20d035822d35
543543
kmodules.xyz/client-go
544544
kmodules.xyz/client-go/api/v1
545545
kmodules.xyz/client-go/apiextensions

0 commit comments

Comments
 (0)